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

2 comments
Comment actions Permalink

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!"


0
Comment actions Permalink

What's myForm?


myForm is an instance of the java class that represents the GUI Form.

As the UI Designer does not work with
JFrames/JDialogs (yet),
you need to perform any operations on this level by
yourself.


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

0

Please sign in to leave a comment.