Designer Quick te preview not same as actual built code?

Swing Designer allows you to quickly create the frames, panels, dialogs, applets and other UI elements that comprise Java Swing applications.

Moderators: Konstantin.Scheglov, gnebling, Alexander.Mitin, jwren, Eric Clayberg

Designer Quick te preview not same as actual built code?

Postby Bach » Sun May 01, 2005 9:44 am

Hi,
Using WindowPro I have screen with lables and textfields. All labels contain same size and the text fileds come in two sizes. The layout is Gridbaglayout.
When testing the screen using the "quick test" button of windowpro, everything look exactly as designed. But actual compiled codes show the labels/textfields on the left hand side of the screen being wider.
Would I need to set the preferred size? if so, how would I know what the preferred size should be since I designed the screen using Windowpro GUI.

How reliable is the quick test button?
Bach
 

Re: Designer Quick te preview not same as actual built code?

Postby Eric Clayberg » Sun May 01, 2005 3:37 pm

Bach wrote:Using WindowPro I have screen with lables and textfields. All labels contain same size and the text fileds come in two sizes. The layout is Gridbaglayout. When testing the screen using the "quick test" button of windowpro, everything look exactly as designed. But actual compiled codes show the labels/textfields on the left hand side of the screen being wider. Would I need to set the preferred size? if so, how would I know what the preferred size should be since I designed the screen using Windowpro GUI. How reliable is the quick test button?

Have you modified the code in any way or added any runtime behavior to it?

The quick test button does not run your code; it shows the same layout that is shown in the design view (which is itself based on parsing your code).

Without seeing an actual example (source code plus scree screen shots of run mode and test mode), it would be hard to know exactly what might be causing the difference.
Eric Clayberg
Software Engineering Manager
Google
http://code.google.com/webtoolkit/download.html

Author: "Eclipse Plug-ins"
http://www.qualityeclipse.com
Eric Clayberg
Moderator
 
Posts: 4503
Joined: Tue Sep 30, 2003 6:39 am
Location: Boston, MA USA

Postby Bach » Sun May 01, 2005 6:23 pm

"The quick test button does not run your code; it shows the same layout that is shown in the design view (which is itself based on parsing your code). "

No I haven't added any runtime behavior :( I just draw the screen using the designer and then run it....

The only thing I did was to add constraint factor. I "only" added WeightX anf fill horizontally. Yes this can affect the display but only when you resize.
Anyway, I went back to remove the weightx and reset the fill to none...it actually gotten worst at run time....but the quick test always looks perfect :evil:
The best it looks is when I had the weightx in on all components with equal amount of 0.3
I wish I had a way to show an image of the screen.
Oh well, wish me luck
Bach
 

Postby Eric Clayberg » Sun May 01, 2005 6:34 pm

Bach wrote: I wish I had a way to show an image of the screen.

If you are using Windows or Linux, the Print Screen function should do the trick.

Without seeing a test case, I have no way of knowing what is going on or what to suggest.
Eric Clayberg
Software Engineering Manager
Google
http://code.google.com/webtoolkit/download.html

Author: "Eclipse Plug-ins"
http://www.qualityeclipse.com
Eric Clayberg
Moderator
 
Posts: 4503
Joined: Tue Sep 30, 2003 6:39 am
Location: Boston, MA USA


Return to Swing Designer

Who is online

Users browsing this forum: No registered users and 1 guest