Frame resize

Guys,

What events will be triggered if you resize a frame? Like, click the maximum button or drag the window.

The problem I have is like this:

I put a toolbar panel on the top of a content panel, and put a scroll panel on the center of that content panel.The scroll panel contains one panel for drawing. I have to set the preferred size of the scroll panel to make the scroll bar to show up. Now if I resize the window, the scroll panel will remain at the preferred size and looks small and ugly.

My thought it to reset the preferred size of the scroll panel when a resizing events were triggered.

Is this alright? What can i do?

Thanks in advance!

[691 byte] By [wateicea] at [2007-10-3 5:20:30]
# 1
Well, maybe you should just use another layout manager and scrap the preferred size.
CeciNEstPasUnProgrammeura at 2007-7-14 23:27:25 > top of Java-index,Java Essentials,Java Programming...
# 2
[url http://java.sun.com/docs/books/tutorial/uiswing/events/handling.html]How to Write a Component Listener[/url]
camickra at 2007-7-14 23:27:25 > top of Java-index,Java Essentials,Java Programming...
# 3

> [url http://java.sun.com/docs/books/tutorial/uiswing/events/handling.html]How to Write a Component Listener[/url]

I hought the OP simply had a component that's not set up to fill out all the available space? Using a listener to adjust that isn't quite the thing to do, I'd say, even though it'd work.

CeciNEstPasUnProgrammeura at 2007-7-14 23:27:25 > top of Java-index,Java Essentials,Java Programming...
# 4

CeciNEstPasUnProgrammeur

Posts:23,032

Registered: 7/23/02

Re: Frame resize

Sep 19, 2006 8:59 AM (reply 1 of 3)

Click to email this message

Well, maybe you should just use another layout manager and scrap the preferred size.

===========================================================

I tried boxlayout and it does work.Thanks!

wateicea at 2007-7-14 23:27:25 > top of Java-index,Java Essentials,Java Programming...