• 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: 3210
78
  • 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: 22185
38
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.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!