if(selRow != -1){
TreePath path = jTree1.getPathForRow(selRow);
TreeNode node = (TreeNode) path.getLastPathComponent();
node.toString(); //id da pessoa
Account aux;
aux=Check_Exists(node.toString());
if(aux!=null){
new Frame_Login(1,null,aux).setVisible(true);
this.dispose();
// jTextField1.setText("");
// SearchKeyPressed(null);
}
else{
JOptionPane.showMessageDialog(null, "Error choosing accounts");
}
}
}
}
}
else if(this.type.equalsIgnoreCase("Remove Account")){
if(evt.getClickCount() == 2) {
try {
eventInTree = true;
}
catch (Exception e) {
System.out.println("Exception occured:OutSide Tree Region");
eventInTree = false;
}
if (eventInTree){
int selRow = jTree1.getRowForLocation(evt.getX(), evt.getY());
if(selRow != -1){
TreePath path = jTree1.getPathForRow(selRow);
TreeNode node = (TreeNode) path.getLastPathComponent();
node.toString(); //id da pessoa
Account aux;
aux=Check_Exists(node.toString());
int aux2=JOptionPane.showConfirmDialog(null,"Are you sure you want to remove this account?");
if(aux!=null){
if(aux2==0){ //yes
this.setVisible(false);