Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 365651

Summary: Live image creation internal error
Product: z_Archived Reporter: Larry Mello <nicc0lo1966>
Component: WindowBuilderAssignee: Alexander Mitin <Alexander.Mitin>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: clayberg
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
This report contains log files, Java files, etc. none

Description Larry Mello CLA 2011-12-05 14:01:47 EST
I want to create a panel that in turn contains nested component panel (I've also created it).  I keep getting an error when I try and drop it onto a new JPanel.

--------------------------------------------

I've created a JPanel that contains other Swing widgets (TCCommonCaseCriteriaPanel).  It has a no-arg constructor and does not access a database.  When I click "Choose Component" in the Palette, I am shown a list of components.  I select the one in question and attempt to drop it onto another JPanel.  I am shown a red/pink box with the words "Exception during live image creation. See error log for details.".  Two interesting notes: (1) was able to successfully drop the nested component into a different class after experiencing this error multiple times; (2) in the "Custom" part of the Palette, the TCCommonCaseCriteriaPanel is listed 9 times.
Comment 1 Larry Mello CLA 2011-12-05 15:09:22 EST
Created attachment 207942 [details]
This report contains log files, Java files, etc.
Comment 2 Larry Mello CLA 2011-12-06 16:04:45 EST
I cut the code from another class that successfully showed the nested class.  I pasted into another class on the Source tab.  When I clicked the Design tab for the class, the nested class showed up fine.  So it appears that the problem is with using the palette to place a nested class.  If you enter a nested class on the Source tab then click the Design tab, it seems to work fine.  I also downgraded this problem's importance to "normal".
Comment 3 Eric Clayberg CLA 2011-12-06 16:14:22 EST
In general, WB does not support components that are nested/inner classes within other classes. All custom components should be represented as top-level Java classes. All custom Swing components should follow normal JavaBean conventions and be public, top-level classes.
Comment 4 Larry Mello CLA 2011-12-06 17:25:31 EST
(In reply to comment #3)
> In general, WB does not support components that are nested/inner classes within
> other classes. All custom components should be represented as top-level Java
> classes. All custom Swing components should follow normal JavaBean conventions
> and be public, top-level classes.

If I mis-spoke, I'm sorry - let me clarify.  When I use the term "nested", all I am talking about it a "uses" type of relationship.  Example: class A and class B are both top-level custom classes that are both descendants of JPanel. Class A has no widgets.  Class B has a button.  Neither class A nor B has inner classes.  The desire is to visually drop class B onto class A so that the developer will see a button on the Design tab when in WB for class A.  I can do this by modifying the source for class A (on the Source tab for class A by including code that instantiates class B) then clicking the Design tab.  However, if I try to visually place class B as a component onto class A (via the Palette's "Choose Component"), I get "Live image creation internal error".
Comment 5 Alexander Mitin CLA 2011-12-07 11:53:37 EST
GroupLayout support issue, fixed in trunk.
Comment 6 Eric Clayberg CLA 2011-12-29 15:07:08 EST
Fixed