public Boolean salvaEdicao(Atleta a, int matricula) { am = new AtletaModel(); if (am.checarAtleta(matricula, a.getMatricula()) == true) { if (am.chegarAtletaRg(a.getRg(), rgAntigo) == true) { if (arquivoImagem == "" || arquivoImagem == null) { arquivoImagem = a.getFoto(); } if (!"".equals(arquivoImagem)) { /*checa se tem imagem.*/ arquivoImagemCaminho = am.savarImagem(a.getMatricula(), arquivoImagem); a.setFoto(arquivoImagemCaminho); } if (am.editar(a, matricula) == true) { JOptionPane.showMessageDialog( null, "Registro alterado.", "Alerta", JOptionPane.INFORMATION_MESSAGE); atm = (AtletaTableModel) AtletaView.atletaTabela.getModel(); atm.setValueAt(a.getMatricula(), linhaSelecionadaTabelela, 0); atm.setValueAt(a.getNome(), linhaSelecionadaTabelela, 1); atm.setValueAt(a.getRg(), linhaSelecionadaTabelela, 2); atm.setValueAt(a.getAtivo(), linhaSelecionadaTabelela, 3); atm.fireTableDataChanged(); return true; } } else { JOptionPane.showMessageDialog(null, "Rg em uso.", "Alerta", JOptionPane.ERROR_MESSAGE); return false; } } else { JOptionPane.showMessageDialog(null, "Matricula em uso.", "Alerta", JOptionPane.ERROR_MESSAGE); return false; } return false; }