• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

how to make jdialog or joption pane vanish automatically ?

 
Ranch Hand
Posts: 232
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
its easy to make joption, but these guys only vanish when i click ok ..
if i want it to vanish automatically after some time (i know the time bit) .. is one way to remove() from the parent container and call validate() so that the
container refreshes ?
if parent container has border layout do i have to put dialog in some part of it, since dialogs normally visually appear to be independant (not fitted within a container).
the way joption function, we never put it inside any container, i wish to achieve the same, but make it vanish without clicking on its default ok button
thanks
 
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well if you have figured out the timed thread part, then why can't you just call the dispose method of the JOptionPane ? In the constructor, the first parameter is of type Component... so it wants the parent component. if you were creating the JOptionPane within the code of your parent frame somewhere...the code might look like this (of course your timer would encompass this code).

this pops up the JOption as a modal dialog in front of the parent frame. Hopefully that helped you out a bit?
 
sarim raza
Ranch Hand
Posts: 232
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am sorry but i cant find any dispose() method, which class has this method, and how can i use this on Joptionpane ?
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic