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 JDialog sizing 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 "JDialog sizing" Watch "JDialog sizing" New topic
Author

JDialog sizing

Jennifer Sohl
Ranch Hand

Joined: Feb 28, 2001
Posts: 455
Hello. I have a JDialog that contains a JSplitPane. Initially when the Dialog comes up, just the left hand component has been added to the JSplitPane. When the user presses a button on the left hand component of the JSplitPane, I add the right hand component to the JSplitPane.
My problem, is when the right component is added, you can't see it unless you resize the JDialog.
I want the JDialog to automatically resize when the right hand component is added to the JSplitPane.
How can I accomplish this?
Thanks!
[ April 09, 2003: Message edited by: Jennifer Sohl ]
raj madhuram
Ranch Hand

Joined: Oct 10, 2001
Posts: 71
Try pack() on the JDialog as soon as the right component gets added.
- Raj
Jennifer Sohl
Ranch Hand

Joined: Feb 28, 2001
Posts: 455
Raj,
That worked great!
Thanks again. You've been a great help. Hopefully someday I can return the favor.
Have a GREAT day!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JDialog sizing
 
Similar Threads
Problem with JSplitPane and JFrame
Dynamically nested JSplitPanes
Resizing in JSplitPane
JSplitPane & window resizing
JSplitPane and its setDividerLocation method