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