• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

modeless dialogs in swing

 
dharini thyagaraj
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Text books talk only about modal dialog in swing. Is there any way to create a modeless dialog?
thanks in advance and best regards,
dharini
 
deekasha gunwant
Ranch Hand
Posts: 396
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi dharini,
you can have both modal and non modal dialogs in swing.
JDialog defines following constructors.
------------------------

JDialog()
Creates a non-modal dialog without a title and without a specified Frame owner.
JDialog(Dialog owner)
Creates a non-modal dialog without a title with the specifed Dialog as its owner.
JDialog(Dialog owner, boolean modal)
Creates a modal or non-modal dialog without a title and with the specified owner dialog.
JDialog(Dialog owner, String title)
Creates a non-modal dialog with the specified title and with the specified owner dialog.
JDialog(Dialog owner, String title, boolean modal) Creates a modal or non-modal dialog with the specified title and the specified owner frame.

-------------------------
In first two and fourth constructors the created dialog is non modal .while in rest of the constructors u can pass true/false depending on whether u want your dialog to be modal/nonmodal.
hope it helps
regards
deeksha

[This message has been edited by deekasha gunwant (edited February 06, 2001).]
 
dharini thyagaraj
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you very much Deeksha!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic