This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes Can I change the size of a Dialog? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Can I change the size of a Dialog?" Watch "Can I change the size of a Dialog?" New topic
Author

Can I change the size of a Dialog?

Biliang Zhou
Ranch Hand

Joined: Jun 28, 2006
Posts: 43
Can I change the size of a Dialog (a modal dialog, like the those created by JOptionPanes)?

What I actually want to do is to have two textfields and a checkbox in the dialog. When you uncheck the checkbox, one of the two textfields hide itself. Thus the size of the Dialog should adapt (i.e., become smaller).

Thank you!
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
maybe something like this

Biliang Zhou
Ranch Hand

Joined: Jun 28, 2006
Posts: 43
Thank you so much for your reply, Michael!

The problem was:

I'm updating an old version of java code (not authored by me), which uses a JOptionPane to bring up a JOptionPane.showConfirmDialog(//argument list//), with a fixed size and no show/hide component.
Now the new version has several show/hide components and thus needs a changeable size.

Now I understand your approach, and it works for me!



[ September 13, 2006: Message edited by: Biliang Zhou ]
[ September 13, 2006: Message edited by: Biliang Zhou ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Can I change the size of a Dialog?