Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

About box - modal / noresizeable  RSS feed

 
Chris Flynn
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is it possible to make a JFrame (or just a SpringLayout really) in Swing that is modal and won't let the user resize the window? Pedantic I know, but it'd be nice!

Cheers,
Chris
 
Sindolfo Filho
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To set the JFrame not resizable: myJFrame.setResizable(false);

I think you can not make a modal JFrame. You could use a JDialog:

myJDialog.setResizable(false);
myJDialog.setModal(true);
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!