This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes resize jdialog Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "resize jdialog" Watch "resize jdialog" New topic
Author

resize jdialog

Cy Bird
Greenhorn

Joined: Feb 18, 2003
Posts: 16
I want to resize a component on a JDialog at the same time the user is resizing the JDialog itself to match dimensions?
Is this possible? (Without using GridBagLayout)
Nathan Pruett
Bartender

Joined: Oct 18, 2000
Posts: 4121

Many other layout managers will also resize components in respect to their parents. BorderLayout is also very good at this. (at least for the component in the CENTER region) Even if you have no layout manager, you can attach a ComponentListener to the parent component and listen for resize events and resize the child component.

A lot of layout managers work off the preferred size of the child components... if you are having trouble with a component not sizing correctly, see what dimensions getPreferredSize() is returning.


-Nate
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
Cy Bird
Greenhorn

Joined: Feb 18, 2003
Posts: 16
I guess that is my question. Is there an example of how to listen for resize events? I tried WindowAdapter and didn't find I want I neeeded there.
Nathan Pruett
Bartender

Joined: Oct 18, 2000
Posts: 4121

You would use the componentResized( ComponentEvent ) method of ComponentListener.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: resize jdialog
 
Similar Threads
how to disable resize
Regarding JDialog
how to set icon on the non resizable jdialog
urgent please help
JDialog sizing