Default JButton for a form
Hi,
Is there a way to set the default button for a form? I've tried:
myForm.getRootPane().setDefaultButton(setButton);
in the constructor for the form, but the getRootPane() method returns null.
Thanks
Tony
Please sign in to leave a comment.
Hello Tony,
TJ> Is there a way to set the default button for a form? I've tried:
TJ>
TJ> myForm.getRootPane().setDefaultButton(setButton);
TJ>
TJ> in the constructor for the form, but the getRootPane() method
TJ> returns null.
What's myForm? As the UI Designer does not work with JFrames/JDialogs (yet),
you need to perform any operations on this level by yourself.
--
Dmitry Jemerov
Software Developer
http://www.jetbrains.com/
"Develop with Pleasure!"
myForm is an instance of the java class that represents the GUI Form.
ok thanks. Ideally, there'd be some way to operate at the frame level - thereby allowing us to add menus and the like as well.
Thanks
Tony