Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / GUI / August 2005

Tip: Looking for answers? Try searching our database.

need wise guidance on componentResized

Thread view: 
6e - 23 Aug 2005 22:40 GMT
Hi thanks for taking the time to read this.

I am using a JFrame with multiple objects (buttons, Jtree, JTables,
Scrollpanes, etc) and I want to be able to make them react
appropriately when ComponentListener's componentResized is called.

Obviously I would like to modify the look of the application if the
user chooses not to maximize the app.

so...

when the application does call ComponentListener I want to go through
all of the components and resize them!  I don't want to create global
objects due to memory concerns, so I tried to call seperate the objects
by using getcomponents() that returns the array of objects, however if
I use instanceof to seperate the pieces out, it doesn't really do the
job, because I have multiple objects of the same instance....

or I don;t fully understand how to seperate the components out for
resizing...

I dont know what to do, any ideas on how I can accomplish this??

Thanks
Pete Barrett - 24 Aug 2005 18:29 GMT
>Hi thanks for taking the time to read this.
>
[quoted text clipped - 18 lines]
>
>I dont know what to do, any ideas on how I can accomplish this??

I think you probably need a LayoutManager. That's how Java usually
deals with parents being resized, not by using ComponentListener. You
may need to write your own (which is actually surprisingly easy, so if
you need to don't be put off), but first have a look at the ones which
come with Java - GridBagLayout looks as if it might be what you want,
though personally I'd rather write my own, it's so complicated! Other
people like it though, and you may be one of them.

Pete Barrett


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.