• 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

JOptionPane and JDialog

 
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I couldn't undrstand how JDialog's show method could invoke JOptionPane.
eg.
if(jdlg.show()==JOptionPane.CANCEL_OPTION)
throw new Exception();
where this two classes are not directly related
in heirarchy.
 
Ranch Hand
Posts: 196
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I don't understand your question. Can you post a bit more code and can you describe a bit clearer, what happens.
Thanks
Rene
 
Anuji Philip
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A sentence from javax.swing.JDialog API from sun ;

You can use this class to create a custom dialog, or invoke the many static methods in JOptionPane to create a variety of standard dialogs


I could not understand the meaning of that.
Kindly explain where this comes and how
 
Ranch Hand
Posts: 508
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
JOptionPane provides a set of static methods to create dialogs that are often needed for user interaction: for example to notify the user of some ongoing or to retrieve input like a password or to ask for a decision (save or save not on exit e.g.).
JOptionPane probably uses JDialog internally though this is of no relevance if you are using JOptionPane.
Even if it seems that the static methods in JOptionPane create only some very common dialogs it is possible to create very special dialogs using these methods. This is the case because the methods take Object instances as arguments instead of, say, Strings to display a message. Thus, you can put a whole panel into a dialog created by JOptionPane. (see the API for JOptionPane for an introduction on the different argument types.)
I for my part have never used JDialog. JOptionPane always proved sufficient and _highly_ customizable enough.
cheers
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic