• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

Can I change the size of a Dialog?

 
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!
 
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
maybe something like this

 
Biliang Zhou
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!