use gui class directly instead of bound form

Hi,

I've created a few custom gui components which extend the JPanel-class and contain an intellij-form-panels as content.

If I add such a class as custom component to the gui palette, and use it within another gui-form, the generated code always looks like the following

final MyGuiClass nestedForm1 = new MyGuiClass (); // this one extends JPanel and is bound to a from file with the same name
panel2.add(nestedForm1.$$$getRootComponent$$$(), BorderLayout.CENTER);

But what I wanted the gui-designer do is, to use my extended JPanel and not not just the form-based panel. (adding without using getRootComponent).

Is there any way to do so? I've tried to edit the component but there seems to be no way to convince the gui-designer to use the class directly instead of the bound form.

Best regards, watzlaw

1 comment

Hello watzlaw,

I've created a few custom gui components which extend the JPanel-class
and contain an intellij-form-panels as content.

If I add such a class as custom component to the gui palette, and use
it within another gui-form, the generated code always looks like the
following

final MyGuiClass nestedForm1 = new MyGuiClass (); // this one
extends JPanel and is bound to a from file with the same name
panel2.add(nestedForm1.$$$getRootComponent$$$(),
BorderLayout.CENTER);
But what I wanted the gui-designer do is, to use my extended JPanel
and not not just the form-based panel. (adding without using
getRootComponent).

Is there any way to do so? I've tried to edit the component but there
seems to be no way to convince the gui-designer to use the class
directly instead of the bound form.


Right now a class which has a bound form is always inserted as a nested form.
As a workaround for the current version, you can bind an inner class of your
JPanel to a form, rather than the JPanel itself. In the next release, this
situation will be handled more correctly.

--
Dmitry Jemerov
Software Developer
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"


0

Please sign in to leave a comment.