Skip to content

Commit

Permalink
Simple GUI is working
Browse files Browse the repository at this point in the history
Simple GUI is working
  • Loading branch information
BookmanTasty committed Oct 12, 2020
1 parent 6541a1c commit 773e7ed
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 14 deletions.
Binary file modified bin/Gui$2.class
Binary file not shown.
Binary file modified bin/Gui$3.class
Binary file not shown.
Binary file modified bin/Gui.class
Binary file not shown.
Binary file modified bin/PngGen.class
Binary file not shown.
Binary file modified bin/gui$4.class
Binary file not shown.
31 changes: 19 additions & 12 deletions src/Gui.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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() {


Expand All @@ -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";
}

}
Expand Down
5 changes: 3 additions & 2 deletions src/PngGen.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import java.io.FileReader;
import java.io.IOException;
import javax.imageio.ImageIO;
import javax.swing.JOptionPane;

public class PngGen {

Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 773e7ed

Please sign in to comment.