WindowBuilder Design Mode changes parent when moving objects [message #762745] |
Thu, 08 December 2011 15:14  |
Eclipse User |
|
|
|
I have a great many Swing screens setup to use the absolute layout. They were all created initially with WindowBuilder Pro (over the years). Without going into the merits of absolute layout model I now find that when I am in design mode and move a visual component the hierarchy of the objects changes with the net effect that the object that I moved is no longer visible.
Effectively my hierarchy starts as something like
JFrame -> ContentPane -> DesktopPane -> JButton
I move the position on screen of the button, expecting that the bounds x,y co-ordinates are updated and find that the structure has changed to
JFrame -> ContentPane -> JButton
I don't want to have to re-invent all my code so that I can continue using WindowBuilder - can anyone suggest what has happened here ?
Dave
[Updated on: Thu, 08 December 2011 15:16] by Moderator Report message to a moderator
|
|
|
|
Re: WindowBuilder Design Mode changes parent when moving objects [message #764026 is a reply to message #763602] |
Sun, 11 December 2011 06:14   |
Eclipse User |
|
|
|
The source code (entire project) can be downloaded from www.commander4j.com - look for version 3.73 and download b4.zip
A good example of the issue can be replicated if you open up the Frame called JFrameHostAdmin.java in the package called com.commander4j.cfg
Use the WindowBuilder visual designer to move the Site No field a few mm in any direction and the source will be reformed so that the object no longer has desktop pane as its parent and disappears from view.
Many thanks for help on this.
Dave
|
|
|
|
|
|
Re: WindowBuilder Design Mode changes parent when moving objects [message #764976 is a reply to message #764832] |
Tue, 13 December 2011 08:06   |
Eclipse User |
|
|
|
Curious. Then it's maybe my environment which is the problem. I am working on a MacBook Pro running OSX Lion.
java version "1.6.0_29"
Java(TM) SE Runtime Environment (build 1.6.0_29-b11-402-11M3527)
Java HotSpot(TM) 64-Bit Server VM (build 20.4-b02-402, mixed mode)
Eclipse 3.7 SR1
(see attached screen dump for detailed versions)
I will try and replicate the problem on a Windows (vmware) machine.
Thanks for your help on this issue.
Dave
|
|
|
Re: WindowBuilder Design Mode changes parent when moving objects [message #764985 is a reply to message #764832] |
Tue, 13 December 2011 08:20   |
Eclipse User |
|
|
|
I've tested within my Windows environment and I cannot replicate the problem, so it's something specific to the OSX setup. I've reinstalled Eclipse and WindowBuilder without any improvement on the OSX front.
Can you suggest anything which would help pin down the nature of the problem in my preferred, default setup ?
Thanks again
Dave
|
|
|
|
|
Re: WindowBuilder Design Mode changes parent when moving objects [message #765809 is a reply to message #765338] |
Wed, 14 December 2011 18:01  |
Eclipse User |
|
|
|
After further investigation, it appears that Apple is doing something unusual under the covers with JDesktopPane which is not done under Windows. They are giving it a custom, non-standard layout (not absolute layout) when it is instantiated which WB does not recognize. WB does not provide editing support for that layout, so it treats it as a generic, unknown layout and basically ignores it as a drop site.
The work around appears to be simple, Be explicit about your layout choice and add "desktopPane.setLayout(null);" to your code. That will force it to actually use absolute layout and WB will be able to edit it.
Also, in researching this, it appears that your use of JDesktopPane itself is very unusual (see its JavaDoc) so I wonder why you are using it this way at all. I'm guessing that what Apple is doing under the covers here is in support of JDesktopPane normal mission in the context of OSX.
|
|
|
Powered by
FUDForum. Page generated in 0.03829 seconds