Gui Designer - How i can load a form?

Hello i was designing a GUI file with the Designer and a bound class was created. But i have really a problem to load such a gui form.
i've seen the generated methods $$$setupUI()$$$ and $$$getRootComponent$$$.

so I've generated a Constructor that invokes $$$setupUI$$$ and do in my main()-method:

new ViewForm()
ViewForm.$$$getRootComponent$$$().setVisible(true);

but it happens nothing.
In the videotutorial (http://www.jetbrains.com/idea/training/demos/GUI_Designer/GUI_Designer.html) just a small exctract of the screen is seen so it does not help anyway. I hope you can help me. Thank you a lot!

2 comments

Hi.

Basically, GUI designer is to create a Panel, and setVisible() is to be apply to a Window with this panel as a content pane.

For example, if GuiForm is the designed form class, then the following code opens the form with this panel:

...
JFrame frame = new JFrame("Test");
frame.setContentPane(new GuiForm().$$$getRootComponent$$$());
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setVisible(true);
...

Alexander.

0

ok thank yo a lot. it works fine now.

0

Please sign in to leave a comment.