int selectedRow = tblAdmin.getSelectedRow();
if (selectedRow == -1) {
JOptionPane.showMessageDialog(rootPane, "You must chose one admin first!", "Error!", JOptionPane.ERROR_MESSAGE);
} else {
int id = (int) tblAdmin.getModel().getValueAt(selectedRow, 0);
AdministratorBean bean = DataAdmin.getAdminByID(id);
lbAccount.setVisible(false);
tfAccount.setVisible(false);
tfAdminName.setText(bean.getFullname());
txtHiddenID.setText(bean.getAdminID() + "");
tfNewpassword.setText("");
tfConfirmPassword.setText("");
lbLine2.setText("New password");
lbLine3.setText("Confirm new password");
btn_ApplyName.setVisible(true);
btn_ApplyPassword.setVisible(true);
btn_ApplyStatus.setVisible(true);
btn_Submit.setVisible(false);
cbbStatus.setSelectedIndex(bean.getStatus());
panelForm.setVisible(true);
this.setSize(this.getWidth(), 580);
}
}//GEN-LAST:event_btn_UpdateActionPerformed