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

non-blocking JDialog  RSS feed

 
Dennis Putnam
Ranch Hand
Posts: 377
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need to create a non-blocking JDialog. I found examples that use Thread as well as invokelater. Which is the preferred method? TIA.
 
Tony Docherty
Bartender
Posts: 3268
82
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You construct the JDialog with the public JDialog(Dialog owner, boolean modal) constructor with 'modal' set to false.
Virtually all swing constructors and methods must be called from the Event Thread (which invokeLater will do), using you own Thread will almost certainly give rise to problems and is definitely not recommended.
 
Paul Clapham
Sheriff
Posts: 22487
43
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You'll find the Oracle tutorial about JDialog here: http://docs.oracle.com/javase/tutorial/uiswing/components/dialog.html

It covers modal versus non-modal very early on in the tutorial. I recommend you go through it.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!