public class AuthenDlg extends JDialog implements ActionListener
{
JPanel panel1 = new JPanel();
JLabel jLabel1 = new JLabel();
JButton jButton1 = new JButton();
JButton jButton2 = new JButton();
JPasswordField jPasswordField1 = new JPasswordField(10);
to drinkant(喝酒的蚂蚁):
天哪!如果是这样的话,那岂不是我在其他想回车的地方都不能回撤了?呵呵!
你可以试试registerKeyboardAction,下面是它的api文档。
public void registerKeyboardAction(ActionListener anAction,
KeyStroke aKeyStroke,
int aCondition)This method is now obsolete, please use a combination of getActionMap() and getInputMap() for similiar behavior.