Browse Source

final Bug fix

master
AntonioFrische 2 years ago
parent
commit
d60be10632
4 changed files with 11 additions and 14 deletions
  1. BIN
      bin/mywindow/antoniofrische/MyWindow$1$1.class
  2. BIN
      bin/mywindow/antoniofrische/MyWindow$1.class
  3. BIN
      bin/mywindow/antoniofrische/MyWindow.class
  4. +11
    -14
      src/mywindow/antoniofrische/MyWindow.java

BIN
bin/mywindow/antoniofrische/MyWindow$1$1.class View File


BIN
bin/mywindow/antoniofrische/MyWindow$1.class View File


BIN
bin/mywindow/antoniofrische/MyWindow.class View File


+ 11
- 14
src/mywindow/antoniofrische/MyWindow.java View File

@ -14,12 +14,12 @@ import javax.swing.JProgressBar;
import javax.swing.JButton; import javax.swing.JButton;
import javax.swing.JLabel; import javax.swing.JLabel;
public class MyWindow implements ActionListener{
public class MyWindow{
private JFrame frame; private JFrame frame;
private JTextField tfInput;
private JTextField tfNewName;
private JProgressBar pbCopy;
private static JTextField tfInput;
private static JTextField tfNewName;
private static JProgressBar pbCopy;
private static JButton btnCopy; private static JButton btnCopy;
/** /**
@ -31,7 +31,12 @@ public class MyWindow implements ActionListener{
try { try {
MyWindow window = new MyWindow(); MyWindow window = new MyWindow();
window.frame.setVisible(true); window.frame.setVisible(true);
btnCopy.addActionListener(window);
btnCopy.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
copiarArch();
}
});
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
@ -76,17 +81,9 @@ public class MyWindow implements ActionListener{
JLabel lblNewLabel = new JLabel("Ruta del FIchero a copiar"); JLabel lblNewLabel = new JLabel("Ruta del FIchero a copiar");
lblNewLabel.setBounds(65, 21, 135, 14); lblNewLabel.setBounds(65, 21, 135, 14);
frame.getContentPane().add(lblNewLabel); frame.getContentPane().add(lblNewLabel);
}
public void actionPerformed(ActionEvent e) {
boolean copy = copiarArch();
if(copy) {
//anything
}else {
//anything
}
} }
private boolean copiarArch() {
private static boolean copiarArch() {
String inputFile = tfInput.getText().toString(); String inputFile = tfInput.getText().toString();
String newName = tfNewName.getText().toString(); String newName = tfNewName.getText().toString();
String[]spliter = inputFile.split("[.]"); String[]spliter = inputFile.split("[.]");


Loading…
Cancel
Save