• 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

Messasge Box Functionality

 
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi guys,
How can i get the effect of a message box using Swing. This is for information, Confirmation etc., .
for instance, i would like to display a message " Do you really want to quit the application?" when the user clicks on the 'Exit' button. Depending on ther user response, i either close the window or put him back to the previous state.
Is there any built-in method/class in Swing to get this done. Or do we have to create our own window with buttons and all.
I would appreciate any information in this regard.

thanks
 
"The Hood"
Posts: 8521
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can use a JDialog with the question as the title. You do have to add your own yes/No buttons and listen to them and decide what to do.
Or you can use a JOptionPane with the showConfirmDialog.

[This message has been edited by Cindy Glass (edited January 28, 2001).]
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic