diff --git a/bin/Gui$2.class b/bin/Gui$2.class index fc3ecd2..ea44987 100644 Binary files a/bin/Gui$2.class and b/bin/Gui$2.class differ diff --git a/bin/Gui$3.class b/bin/Gui$3.class index a6b2580..b475952 100644 Binary files a/bin/Gui$3.class and b/bin/Gui$3.class differ diff --git a/bin/Gui.class b/bin/Gui.class index c1dcf02..4fd4f24 100644 Binary files a/bin/Gui.class and b/bin/Gui.class differ diff --git a/bin/PngGen.class b/bin/PngGen.class index bfe7f9c..61aad9c 100644 Binary files a/bin/PngGen.class and b/bin/PngGen.class differ diff --git a/bin/gui$4.class b/bin/gui$4.class index 5387024..3fb46d3 100644 Binary files a/bin/gui$4.class and b/bin/gui$4.class differ diff --git a/src/Gui.java b/src/Gui.java index fe704a4..1763ad6 100644 --- a/src/Gui.java +++ b/src/Gui.java @@ -56,13 +56,15 @@ public gui() { /** * Initialize the contents of the frame. */ - private void initialize() { + public void initialize() { frmvouchersGeneradorDe = new JFrame(); frmvouchersGeneradorDe.setTitle("99Vouchers Generador de Fichas"); frmvouchersGeneradorDe.setResizable(false); frmvouchersGeneradorDe.setBounds(100, 100, 568, 302); frmvouchersGeneradorDe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + + JPanel panel = new JPanel(); frmvouchersGeneradorDe.getContentPane().add(panel, BorderLayout.SOUTH); @@ -81,34 +83,40 @@ public void actionPerformed(ActionEvent e) { JPanel panel_1 = new JPanel(); frmvouchersGeneradorDe.getContentPane().add(panel_1, BorderLayout.NORTH); + JLabel lblSEL = new JLabel(rdyI); + JLabel lblCSV = new JLabel(rdyC); + JButton loadIMG = new JButton("Cargar Plantilla"); loadIMG.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { cargarIMG(); - + lblSEL.setText(rdyI); + } }); - panel_1.add(loadIMG); + JButton loadCSV = new JButton("Cargar Usuarios"); loadCSV.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { cargarCSV(); + lblCSV.setText(rdyC); + } }); - JLabel lblSEL = new JLabel(rdyI); + panel_1.add(loadIMG); panel_1.add(lblSEL); panel_1.add(loadCSV); - - - JLabel lblCSV = new JLabel(rdyC); panel_1.add(lblCSV); - Canvas canvas = new Canvas(); - frmvouchersGeneradorDe.getContentPane().add(canvas, BorderLayout.CENTER); + } + + + + private void cargarIMG() { @@ -123,9 +131,8 @@ private void cargarIMG() { if (returnValue == JFileChooser.APPROVE_OPTION) { File selectedFile = jfc.getSelectedFile(); - archIMG = selectedFile.getAbsolutePath(); - rdyI = "Seleccionado"; - + archIMG = selectedFile.getAbsolutePath(); + rdyI = "Seleccionado"; } } diff --git a/src/PngGen.java b/src/PngGen.java index 75fb615..129525d 100644 --- a/src/PngGen.java +++ b/src/PngGen.java @@ -8,6 +8,7 @@ import java.io.FileReader; import java.io.IOException; import javax.imageio.ImageIO; +import javax.swing.JOptionPane; public class PngGen { @@ -47,8 +48,8 @@ public static void csvRead(String pngFile, String csvFile, String salCSV) { } catch (IOException e) { e.printStackTrace(); } catch (java.lang.ArrayIndexOutOfBoundsException e) { - System.out.println("Se ha terminado de convertir el csv"); - System.out.println("Se generaron " + j + " fichas a partir del csv"); + System.out.println("Se generaron " + j + " fichas a partir del csv"); + JOptionPane.showMessageDialog (null, "Se generaron " + j + " fichas a partir del csv"); } finally { if (br != null) { try {