import java.io.FileNotFoundException;
import java.io.IOException;
import javax.swing.*;
import java.awt.*;
import java.awt.geom.Rectangle2D;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.FileOutputStream;
import javax.imageio.ImageIO;
import net.sourceforge.barbecue.Barcode;
import net.sourceforge.barbecue.BarcodeException;
import net.sourceforge.barbecue.BarcodeFactory;
import net.sourceforge.barbecue.BarcodeImageHandler;
import net.sourceforge.barbecue.output.OutputException;
public class Ventana
extends JFrame {
{
super ();
this.setSize(300, 295);
//this.setSize(1470, 1350);
this.
setBackground(Color.
white); Barcode barcode = BarcodeFactory.createCode39("N14U-93110-00",false);
barcode.setDrawingText(false);
barcode.setBarHeight(45);
barcode.setBarWidth(1);
BarcodeImageHandler.writeJPEG(barcode, fos);
Barcode barcode_q = BarcodeFactory.createCode39("Q8",false);
barcode_q.setDrawingText(false);
barcode_q.setBarHeight(45);
barcode_q.setBarWidth(1);
BarcodeImageHandler.writeJPEG(barcode_q, fos_q);
Barcode barcode_l = BarcodeFactory.createCode39("L1111",false);
barcode_l.setDrawingText(false);
barcode_l.setBarHeight(45);
barcode_l.setBarWidth(1);
BarcodeImageHandler.writeJPEG(barcode_l, fos_l);
country.
setFont(new java.
awt.
Font("Arial",
1,
10)); item.
setFont(new java.
awt.
Font("Arial",
1,
8)); item_comp.
setFont(new java.
awt.
Font("Arial",
1,
8)); item_no.
setFont(new java.
awt.
Font("Arial",
1,
12)); image.setIcon(icon);
qty.
setFont(new java.
awt.
Font("Arial",
1,
12)); Quantity.
setFont(new java.
awt.
Font("Arial",
1,
8)); q.
setFont(new java.
awt.
Font("Arial",
1,
8)); image_q.setIcon(icon_q);
l.
setFont(new java.
awt.
Font("Arial",
1,
12)); lot.
setFont(new java.
awt.
Font("Arial",
1,
8)); lo.
setFont(new java.
awt.
Font("Arial",
1,
8)); image_l.setIcon(icon_l);
c.
setFont(new java.
awt.
Font("Arial",
1,
12)); cus.
setFont(new java.
awt.
Font("Arial",
1,
8)); country2.
setFont(new java.
awt.
Font("Arial",
1,
10));
constraints.gridx = 1;
constraints.gridy = 0;
constraints.gridwidth = 1;
constraints.gridheight = 1;
constraints.weightx=0;
constraints.weightx=0;
this.add (country, constraints);
constraints.gridx = 0;
constraints.gridy = 1;
constraints.gridwidth = 1;
constraints.gridheight = 1;
this.add (item, constraints);
constraints.gridx = 0;
constraints.gridy = 2;
constraints.gridwidth = 1;
constraints.gridheight = 1;
this.add (item_comp, constraints);
constraints.gridx = 1;
constraints.gridy = 2;
constraints.gridwidth = 1;
constraints.gridheight = 1;
this.add (item_no, constraints);
constraints.gridx = 1;
constraints.gridy = 3;
constraints.gridwidth = 1;
constraints.gridheight = 1;
this.add (image, constraints);
constraints.gridx = 0;
constraints.gridy = 4;
constraints.gridwidth = 1;
constraints.gridheight = 1;
this.add (espacio, constraints);
constraints.gridx = 0;
constraints.gridy = 5;
constraints.gridwidth = 1;
constraints.gridheight = 1;
this.add (Quantity, constraints);
constraints.gridx = 0;
constraints.gridy = 6;
constraints.gridwidth = 1;
constraints.gridheight = 1;
this.add (q, constraints);
constraints.gridx = 1;
constraints.gridy = 6;
constraints.gridwidth = 1;
constraints.gridheight = 1;
this.add (qty, constraints);
constraints.gridx = 1;
constraints.gridy = 7;
constraints.gridwidth = 1;
constraints.gridheight = 1;
this.add (image_q, constraints);
constraints.gridx = 0;
constraints.gridy = 8;
constraints.gridwidth = 1;
constraints.gridheight = 1;
this.add (espacio, constraints);
constraints.gridx = 0;
constraints.gridy = 9;
constraints.gridwidth = 1;
constraints.gridheight = 1;
this.add (lot, constraints);
constraints.gridx = 0;
constraints.gridy = 10;
constraints.gridwidth = 1;
constraints.gridheight = 1;
this.add (lo, constraints);
constraints.gridx = 1;
constraints.gridy = 10;
constraints.gridwidth = 1;
constraints.gridheight = 1;
this.add (l, constraints);
constraints.gridx = 1;
constraints.gridy = 11;
constraints.gridwidth = 1;
constraints.gridheight = 1;
this.add (image_l, constraints);
constraints.gridx = 0;
constraints.gridy = 12;
constraints.gridwidth = 1;
constraints.gridheight = 1;
this.add (espacio, constraints);
constraints.gridx = 0;
constraints.gridy = 13;
constraints.gridwidth = 1;
constraints.gridheight = 1;
this.add (cus, constraints);
constraints.gridx = 1;
constraints.gridy = 13;
constraints.gridwidth = 1;
constraints.gridheight = 1;
this.add (c, constraints);
constraints.gridx = 1;
constraints.gridy = 14;
constraints.gridwidth = 1;
constraints.gridheight = 1;
this.add (country2, constraints);
g.drawRect(1, 1, 296, 108);
g.drawRect(1,109, 296, 72);
g.drawRect(1,181, 296, 72);
g.drawRect(1,253, 296, 38);
g.
setXORMode(Color.
black); this.paint(g);
ImageIO.
write(imagen,
"jpg",
new File("c:/prueba.jpg")); //ImageIO.write(imagen,"jpg",new File("c:/prueba.jpg"));
}
Ventana obj= new Ventana();
obj.setVisible(true);
}
}