File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

multiple modal dialogs

 
Vijay Kashyap
Ranch Hand
Posts: 74
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Is it possible to have more than 1 modal dialog for different JFrames. I have to pop up a modal dialog on click of a button ( which is on a JFrame), that part is easy but tricky part is, there could be cases where I have multiple instance of JFrames visible on screen but since a Modal Dialog is already poped up it blocks the input to other JFrames.
Is there a possible solution out of this ? I used to think that a modal dialog is modal to its parent Frame , but it seems to be modal to all other Frames.
Regards,
Vijay
 
Manfred Leonhardt
Ranch Hand
Posts: 1492
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Vijay,
As you may have guessed, Modal is to your application (all Frames). The only way out is to use non-modal dialogs and have each frame keep track of their own private dialog.
Regards,
Manfred.
 
Vijay Kashyap
Ranch Hand
Posts: 74
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Manfred,
Thanks for replying to my query.
Could you point out how to make a JDaolog behave as a modal dialog with out setting it modal explicitly. I tried JLayeredPane, it seems to provide soln only for JPanel but not JDialog. Is there any neat solution to my problem ?
Regards,
Vijay
 
Manfred Leonhardt
Ranch Hand
Posts: 1492
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Vijay,
No, there is no way to make a dialog modal to only a frame in Java. I don't know of any solution to your problem without writing some native code routines.
Regards,
Manfred.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic