Try dialog.getRootPane().setDefaultButton(null); ----- Original Message ----- From: <[EMAIL PROTECTED]> To: <[email protected]> Sent: Thursday, March 03, 2005 7:07 PM Subject: [Juglist] JButton Action Key Binding
> Hello to all, > > I been working on a little Swing application where I extends JDialog to create a LoginDialog class. It includes a JTextField for user id, a JPasswordField for a password and two JButton objects -- for login and cancel. Upon testing this I discovered that I can tab to the JButtons, but the ENTER key does not fire the button actions. The button actions are fired by the SPACE key. I done some research using Google and found that since Java 1.2 this is the default behavior. I have found and successfully tested solutions that enable the ENTER key to fire the button action. So far, so good. However, I would also like to disable the default ehavior -- so the SPACE key does not fire the action. Does anyone know how to do this? > > Dennis > > > > > _______________________________________________ > Juglist mailing list > [email protected] > http://trijug.org/mailman/listinfo/juglist_trijug.org _______________________________________________ Juglist mailing list [email protected] http://trijug.org/mailman/listinfo/juglist_trijug.org
