validateSelection();
}
});
+ tbl_summary.addKeyListener(new KeyAdapter()
+ {
+ @Override
+ public void keyPressed(KeyEvent evt)
+ {
+ validateSelection();
+ switch (evt.getKeyCode())
+ {
+ case KeyEvent.VK_ESCAPE: // escape key
+ btn_back_ActionPerformed();
+ break;
+ case KeyEvent.VK_ENTER: // enter key
+ btn_ok_ActionPerformed();
+ break;
+ case KeyEvent.VK_TAB: // tab key
+ btn_back.requestFocus();
+ default:
+ return;
+ }
+ }
+ });
btn_back.setFont(new java.awt.Font("Verdana", 0, 12));
btn_back.setText(MessageManager.getString("action.back"));
btn_back_ActionPerformed();
}
});
+ btn_back.addKeyListener(new KeyAdapter()
+ {
+ @Override
+ public void keyPressed(KeyEvent evt)
+ {
+ if (evt.getKeyCode() == KeyEvent.VK_ENTER)
+ {
+ btn_back_ActionPerformed();
+ }
+ }
+ });
btn_ok.setEnabled(false);
btn_ok.setFont(new java.awt.Font("Verdana", 0, 12));
btn_ok_ActionPerformed();
}
});
+ btn_ok.addKeyListener(new KeyAdapter()
+ {
+ @Override
+ public void keyPressed(KeyEvent evt)
+ {
+ if (evt.getKeyCode() == KeyEvent.VK_ENTER)
+ {
+ btn_ok_ActionPerformed();
+ }
+ }
+ });
+
btn_cancel.setFont(new java.awt.Font("Verdana", 0, 12));
btn_cancel.setText(MessageManager.getString("action.cancel"));
btn_cancel.addActionListener(new java.awt.event.ActionListener()
btn_cancel_ActionPerformed();
}
});
+ btn_cancel.addKeyListener(new KeyAdapter()
+ {
+ @Override
+ public void keyPressed(KeyEvent evt)
+ {
+ if (evt.getKeyCode() == KeyEvent.VK_ENTER)
+ {
+ btn_cancel_ActionPerformed();
+ }
+ }
+ });
scrl_searchResult.setPreferredSize(new Dimension(500, 300));
scrl_searchResult
import java.awt.event.ActionEvent;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
+import java.awt.event.KeyAdapter;
+import java.awt.event.KeyEvent;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.util.Arrays;
{
tbl_summary.setAutoCreateRowSorter(true);
tbl_summary.getTableHeader().setReorderingAllowed(false);
+ tbl_summary.addMouseListener(new MouseAdapter()
+ {
+ public void mouseClicked(MouseEvent e)
+ {
+ validateSelections();
+ }
+
+ public void mouseReleased(MouseEvent e)
+ {
+ validateSelections();
+ }
+ });
+ tbl_summary.addKeyListener(new KeyAdapter()
+ {
+ @Override
+ public void keyPressed(KeyEvent evt)
+ {
+ validateSelections();
+ switch (evt.getKeyCode())
+ {
+ case KeyEvent.VK_ESCAPE: // escape key
+ mainFrame.dispose();
+ break;
+ case KeyEvent.VK_ENTER: // enter key
+ ok_ActionPerformed();
+ break;
+ case KeyEvent.VK_TAB: // tab key
+ btn_cancel.requestFocus();
+ default:
+ return;
+ }
+ }
+ });
tbl_local_pdb.setAutoCreateRowSorter(true);
tbl_local_pdb.getTableHeader().setReorderingAllowed(false);
tbl_local_pdb.addMouseListener(new MouseAdapter()
{
public void mouseClicked(MouseEvent e)
{
- updateCurrentView();
+ validateSelections();
}
public void mouseReleased(MouseEvent e)
{
- updateCurrentView();
+ validateSelections();
+ }
+ });
+ tbl_local_pdb.addKeyListener(new KeyAdapter()
+ {
+ @Override
+ public void keyPressed(KeyEvent evt)
+ {
+ validateSelections();
+ switch (evt.getKeyCode())
+ {
+ case KeyEvent.VK_ESCAPE: // escape key
+ mainFrame.dispose();
+ break;
+ case KeyEvent.VK_ENTER: // enter key
+ ok_ActionPerformed();
+ break;
+ case KeyEvent.VK_TAB: // tab key
+ btn_cancel.requestFocus();
+ default:
+ return;
+ }
}
});
-
btn_view.setFont(new java.awt.Font("Verdana", 0, 12));
btn_view.setText(MessageManager.getString("action.view"));
btn_view.addActionListener(new java.awt.event.ActionListener()
ok_ActionPerformed();
}
});
+ btn_view.addKeyListener(new KeyAdapter()
+ {
+ @Override
+ public void keyPressed(KeyEvent evt)
+ {
+ if (evt.getKeyCode() == KeyEvent.VK_ENTER)
+ {
+ ok_ActionPerformed();
+ }
+ }
+ });
+
btn_cancel.setFont(new java.awt.Font("Verdana", 0, 12));
btn_cancel.setText(MessageManager.getString("action.cancel"));
btn_cancel.addActionListener(new java.awt.event.ActionListener()
mainFrame.dispose();
}
});
+ btn_cancel.addKeyListener(new KeyAdapter()
+ {
+ @Override
+ public void keyPressed(KeyEvent evt)
+ {
+ if (evt.getKeyCode() == KeyEvent.VK_ENTER)
+ {
+ mainFrame.dispose();
+ }
+ }
+ });
btn_pdbFromFile.setFont(new java.awt.Font("Verdana", 0, 12));
String btn_title = MessageManager.getString("label.select_pdb_file");
pdbFromFile_actionPerformed();
}
});
+ btn_pdbFromFile.addKeyListener(new KeyAdapter()
+ {
+ @Override
+ public void keyPressed(KeyEvent evt)
+ {
+ if (evt.getKeyCode() == KeyEvent.VK_ENTER)
+ {
+ pdbFromFile_actionPerformed();
+ }
+ }
+ });
scrl_foundStructures.setPreferredSize(new Dimension(500, 300));
scrl_foundStructures