• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Modal Dialog

 
Ranch Hand
Posts: 146
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi
I have a Frame with a button and on click of that button it opens a JDialog which is supposed to be modal...
I have tried using the JDialog(String title, boolean modal) constructor and see no effect...
so i included the code setModal(true); in the constructor in this case
1. when the setModal(true) is before the setVisible(true) i get 2 dialogs the second one with just the last object added to the view and when i close it the actual dialog is there and is modal
2. when it is after the setVisible(true) i see no effect which is supposed to be correct.

How do i correct is? when i use that constructor isnt it supposed to be modal?
Any solutions?
Thanks
Vidhya
 
Balaji Anand
Ranch Hand
Posts: 146
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
sorry the problem is solved... i gave setModal before the setVisible and it works... i had two setvisible commands by mistake that was the reason for the 2 windows.
I dont know y the constructor part is not working...
Thanks
 
Hey, sticks and stones baby. And maybe a wee mention of my stuff:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic