• Post Reply Bookmark Topic Watch Topic
  • New Topic

set width of dialog  RSS feed

 
tormod eriksen
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is it possible to set the desired width of a dialog constructed by JOptionPane.showMessageDialog(....) and the other related methods (showOptionsDialog, ..)?
If the message argument is long there may be text that doesn't show. And it would be nice to be able to show a dialog of consistent width.
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No... you don't get a direct reference to the JDialog when you call the static showXXXDialog(...) methods. You'll have to either use JOptionPane differently (see the Direct Use section in the class documentation of the API), or use a JDialog instead of JOptionPane.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!