Thread View: borland.public.jbuilder.java.swing
5 messages
5 total messages
Started by TJC
Wed, 25 Feb 2004 14:45
Swing GUI problem - after a compile, components shift back to original size/position.
Author: TJC
Date: Wed, 25 Feb 2004 14:45
Date: Wed, 25 Feb 2004 14:45
22 lines
2161 bytes
2161 bytes
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. What is up?? I am using JBuilder 10. I would think version "10" would be a little more stable than this. I recently started using JBuilder again since moving from another IDE. I saw this same issue when I was using Jbuilder 7. Man is this frustrating. Any help please? Thanks in advanced.
Re: Swing GUI problem - after a compile, components shift back to original size/position.
Author: pnichols
Date: Wed, 25 Feb 2004 19:28
Date: Wed, 25 Feb 2004 19:28
12 lines
1666 bytes
1666 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 Bottom line is that you should not use XYLayout. It is more for design only. If you try shipping to other platforms and/or even other graphics cards, it will not look correct.
Re: Swing GUI problem - after a compile, components shift back to original size/position.
Author: pnichols
Date: Wed, 25 Feb 2004 19:33
Date: Wed, 25 Feb 2004 19:33
15 lines
1798 bytes
1798 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 You really should not use the XYLayout manager. It is more or less for design time only. If you deploy to a different machine, you can have trouble, and if you deploy from say Windows to Linux, it will never look right. Using nested panels and the javasoft Layout Managers are the way to go. Avoid null and XYLayout for all but design mode.
Re: Swing GUI problem - after a compile, components shift back to original size/position.
Author: 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.
Re: Swing GUI problem - after a compile, components shift back to original size/position.
Author: Graham Perks
Date: Fri, 27 Feb 2004 01:58
Date: Fri, 27 Feb 2004 01:58
33 lines
2606 bytes
2606 bytes
[[ This message was both posted and mailed: see the "To," "Cc," and "Newsgroups" headers for details. ]] One good replacement for XYLayout is Foam, which you can see at http://www.computersinmotion.com There are demos where you can watch Foam in action, and they make good tutorials. Foam combines the ease of use of XYLayout with the power of a sophisticated layout engine. Designs made with Foam are platform-neutral and much simpler to design (and MAINTAIN!!!) than writing your layout in Java code, as with, say GridBagLayout. Check it out at http://www.computersinmotion.com Cheers, Graham Perks. In article <403cf4a8@newsgroups.borland.com>, pnichols <paul@comp.net> wrote: > 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 > > Bottom line is that you should not use XYLayout. It is more for design only. > > If you try shipping to other platforms and/or even other graphics cards, it > will not look correct. >
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads