• Post Reply Bookmark Topic Watch Topic
  • New Topic

non-blocking JDialog

 
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
Saloon Keeper
Posts: 3137
72
  • 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: 21862
36
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!