});
cargarFotoButt.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
FileChooser chooser = new FileChooser();
int returnVal = chooser.showOpenDialog(PresoController.this);
if (returnVal == JFileChooser.APPROVE_OPTION) {
try {
File file = chooser.getSelectedFile();
if (file.exists()) {
System.out.println("File " + file.getPath());
fotoPersonal = new ImageIcon(file.getPath());
if (fotoPersonal.getIconHeight() <= ICON_HEIGHT && fotoPersonal.getIconWidth() <= ICON_WIDTH) {
fotoLabel.setIcon(fotoPersonal);
InputStream fis = new FileInputStream(file);
bufferFoto = new byte[(int) file.length()];
int readers = fis.read(bufferFoto);
System.out.println("Hola");
} else {
MessageGenerator.showWarningMsj("Imagen", "La imagen es muy grande");
}
}
} catch (IOException ex) {
Logger.getLogger(PresoController.class.getName()).log(Level.SEVERE, null, ex);
}
}
}
});
cargarHuellaBt.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
FileChooser chooser = new FileChooser();
int returnVal = chooser.showOpenDialog(PresoController.this);
if (returnVal == JFileChooser.APPROVE_OPTION) {
File file = chooser.getSelectedFile();
//This is where a real application would open the file.
System.out.println("File " + file.getPath());
if (file.exists()) {
System.out.println("Tamaño " + file.length());