Nested Forms

I am new to using the UI Designer and have successfully made some basic forms. I am now attempting to create a new form consisting of a JTabbedPane where each tab contains a form I have already constructed.
I first tried to nest my custom form in the JTabbedPane by selecting the "Non-Palette Component" from the Palette, clicking on the JTabbedPane and then selecting the Form from the "Add Non-Palette Component" window. After clicking OK, nothing appears in the form containing the JTabbedPane and the UI Designer still acts as the "Non-Palette Component" has not been placed. The next thing I tried was adding the form to the palette and then adding it to the JTabbedPane like any of the other swing components. This was met with a similar result.
My question is if there is some step I am missing in order to use nested forms, or is this just a bug of the UI Designer that has yet to be worked out? I am currently using IntelliJ IDEA 6.0.5, build #6180.

Thanks.

0
5 comments

Hello spike,

Your steps look correct. I cannot reproduce the bug.
When you put a nested form into main form, do you see nested form item in
UI designer tree view at left?

I am new to using the UI Designer and have successfully made some
basic forms. I am now attempting to create a new form consisting of a
JTabbedPane where each tab contains a form I have already constructed.
I first tried to nest my custom form in the JTabbedPane by selecting
the "Non-Palette Component" from the Palette, clicking on the
JTabbedPane and then selecting the Form from the "Add Non-Palette
Component" window. After clicking OK, nothing appears in the form
containing the JTabbedPane and the UI Designer still acts as the
"Non-Palette Component" has not been placed. The next thing I tried
was adding the form to the palette and then adding it to the
JTabbedPane like any of the other swing components. This was met with
a similar result.
My question is if there is some step I am missing in order to use
nested forms, or is this just a bug of the UI Designer that has yet to
be worked out? I am currently using IntelliJ IDEA 6.0.5, build #6180.
Thanks.


Alexander Chernikov
JetBrains Inc.


0

Alexander,
Thanks for you response.

Your steps look correct. I cannot reproduce the bug.
When you put a nested form into main form, do you see
nested form item in UI designer tree view at left?


No the contents of the UI designer remain the same. The nested form does not show up in the UI Designer window and if I click on the form again it will bring up the "Add Non-Palette Component" window again.

I downloaded the UIDesignerSample project and was able to nest a form in the SamplePanel.form successfully after a couple of tries.

I attempted to reproduce the nesting by creating a separate project in which I created two new forms, one containing a JLabel and JTextField and the other containing a JTabbedPane. When I first attempt to nest the JLabel form into the JTabbedPane using the Non-Palette Component, I get an error message reading, "Forms added to palette mush have a binding for the top-level component." Once I build the project, this message disappears, but the I get same behavior as before where the form is not inserted and the UI Designer does not display the nested form.

In my original application, all of the Form panels use GridBagLayout and in the simple test all of the Form panels use GridLayoutManager(IntelliJ).

Thanks.

0

Hello spike,

When I first attempt to nest
the JLabel form into the JTabbedPane using the Non-Palette Component,
I get an error message reading, "Forms added to palette mush have a
binding for the top-level component."


BTW, thanks, I see this issue in 6180, it is avoided in new version 7.0.

Once I build the project, this
message disappears, but the I get same behavior as before where the
form is not inserted and the UI Designer does not display the nested
form.


Can you zip your test project and attach it? My forms are still nested successfully.

Alexander.


0

Alexander,

Can you zip your test project and attach it? My forms
are still nested successfully.


Upon cleaning up the project to send to you I deleted the classes directory. After doing this, closing the project, and reopening the project I was able to successfully nest the forms. After performing this procedure on my original project I was also able to successfully nest the forms. I created another project to see if I could duplicate the problematic behavior I was seeing initially and was successful. Attached is the project with the problem I was seeing. Performing the procedure described above fixes the problem.

Thanks.



Attachment(s):
nestedForms.zip
0

Hello spike,

I think I've got it. This is probably http://www.jetbrains.net/jira/browse/IDEADEV-16243.
To draw a component in Designer IDEA instatiates component's class using
JDK it runs with.
If component class is made by 1.6, and IDEA runs with 1.5, then UnsupportedClassVersionError
happens and creating component fails. You have to either run with 1.6 or
re-compile project with 1.5.
If your idea.log contains UnsupportedClassVersionError, this is that case.

Alexander,

>> Can you zip your test project and attach it? My forms are still
>> nested successfully.
>>

Upon cleaning up the project to send to you I deleted the classes
directory. After doing this, closing the project, and reopening the
project I was able to successfully nest the forms. After performing
this procedure on my original project I was also able to successfully
nest the forms. I created another project to see if I could duplicate
the problematic behavior I was seeing initially and was successful.
Attached is the project with the problem I was seeing. Performing the
procedure described above fixes the problem.

Thanks.

Alexander.


0

Please sign in to leave a comment.