Article View: borland.public.jbuilder.java.swing
Article #1235Re: Swing GUI problem - after a compile, components shift back to original size/position.
From: Paul Furbacher [TeamB]
Date: Wed, 25 Feb 2004 19:50
Date: Wed, 25 Feb 2004 19:50
74 lines
4423 bytes
4423 bytes
TJC wrote:
> This is frustrating! I am designing a simple panel using the XYLayout. I
> quite often get into a situtation (not sure why/how) where I am aligning
> some components by multi-selecting them and choosing "Align Left" from the
> right-mouse context menu for example. The UI aligns them perfectly and
> things look great. BUT when I compile (Ctrl-Shift-F9) the components that I
> just aligned go right back to their old position. I see this sort of stuff
> ALL THE TIME using this GUI. I bring a component to the front of another
> object....re-compile, and poof! the component goes right back to the
> previous state. I have wasted literally hours and hours fighting JBuilder
> trying to get out of this situation. I delete the components, re add
> them...I try to go to the source and move contructors around and recompile.
> Sometimes it helps, but most times it does not.
Paul Nichol's advice to not use the XYLayout is
something you should perhaps even extend to design time.
For some years now, I haven't used the XYLayout when
designing. Instead, I go straight to using a GridBagLayout
with new Panels, etc.
Having said that, it may be that what you are facing
is some of the quirkiness of the Designer. There are
reports that suggest that the Designer can get out
of sync with the underlying code. When it gets into
this state, changes you make in the Designer don't
get updated in the source code. No one knows how or
why this happens. Some users declare that it has never
happened to them.
The only thing I can suggest is that you start JBuilder X
up with the -verbose option. You might think about making
a Windows shortcut (or a shell script if using Linux, Solaris
or Mac OS X) which targets:
[path to JBuilder X]/JBuilderX/bin/JBuilder.exe -verbose
Once you start encountering the problem you describe,
flip to the console window (make sure you have configured
the buffer height to a rather large number, e.g., 3000,
in the "Layout" tab of the shortcut) and scroll back
to see if there are any exceptions being thrown which
seem to be related to the Designer. That may give you
a clue as to what triggered the problem and what you
can do to avoid triggering it again. I'm afraid
that once this problem starts, the only way to
restore the Designer to a working state is to
restart JBuilder.
But please do consider abandoning your use of
the crutch called XYLayout. If you need a crutch,
try using the NullLayout. But I'd suggest throwing
away the crutches completely. You may have been
avoiding the GridBagLayout because it seems too
complex. However, you'll be doing yourself a favor
if buckle down and really learn it. I say this
from experience (as I've said so many times in
the last 6 years or so in these newsgroups).
--
Paul Furbacher (TeamB)
Save time, search the archives:
http://www.borland.com/newsgroups/ngsearch.html
Is it in Joi Ellis's Faq-O-Matic?
http://www.visi.com/~gyles19/fom-serve/cache/1.html
Finally, please send responses to the newsgroup only.
That means, do not send email directly to me.
Thank you.
Technical Details
Message-ID:
<403cfc99$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-05!sn-xit-09!supernews.com!newshosting.com!nx01.iad01.newshosting.com!newsfeed.icl.net!newsfeed.fjserv.net!news-FFM2.ecrc.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<403cb4fa$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111d45,39a79768d2815a95 X-Google-Attributes: gid111d45,public X-Google-ArrivalTime: 2004-02-25 12:10:37 PST Date: Wed, 25 Feb 2004 14:50:50 -0500 From: "Paul Furbacher [TeamB]" <pfurbacher@mac.com> Organization: Reverse Alchemy, Inc. User-Agent: Mozilla Thunderbird 0.5 (Macintosh/20040208) X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: borland.public.jbuilder.java.swing Subject: Re: Swing GUI problem - after a compile, components shift back to original size/position. References: <403cb4fa$1@newsgroups.borland.com> In-Reply-To: <403cb4fa$1@newsgroups.borland.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 68.39.103.120 Message-ID: <403cfc99$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1077738649 68.39.103.120 (25 Feb 2004 11:50:49 -0800) Lines: 74 Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-05!sn-xit-09!supernews.com!newshosting.com!nx01.iad01.newshosting.com!newsfeed.icl.net!newsfeed.fjserv.net!news-FFM2.ecrc.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail