Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

multiple modal dialogs

 
Ranch Hand
Posts: 74
  • 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
 
Ranch Hand
Posts: 1492
  • 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
  • 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
  • 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.
 
    Bookmark Topic Watch Topic
  • New Topic