src/share/classes/javax/swing/JOptionPane.java

Print this page




  45 import java.io.IOException;
  46 import java.io.ObjectInputStream;
  47 import java.io.ObjectOutputStream;
  48 import java.io.Serializable;
  49 import java.lang.reflect.Method;
  50 import java.lang.reflect.InvocationTargetException;
  51 import java.security.AccessController;
  52 import java.security.PrivilegedAction;
  53 import java.util.Vector;
  54 import javax.swing.plaf.OptionPaneUI;
  55 import javax.swing.event.InternalFrameEvent;
  56 import javax.swing.event.InternalFrameAdapter;
  57 import javax.accessibility.*;
  58 import static javax.swing.ClientPropertyKey.PopupFactory_FORCE_HEAVYWEIGHT_POPUP;
  59 
  60 /**
  61  * <code>JOptionPane</code> makes it easy to pop up a standard dialog box that
  62  * prompts users for a value or informs them of something.
  63  * For information about using <code>JOptionPane</code>, see
  64  * <a
  65  href="http://java.sun.com/docs/books/tutorial/uiswing/components/dialog.html">How to Make Dialogs</a>,
  66  * a section in <em>The Java Tutorial</em>.
  67  *
  68  * <p>
  69  *
  70  * While the <code>JOptionPane</code>
  71  * class may appear complex because of the large number of methods, almost
  72  * all uses of this class are one-line calls to one of the static
  73  * <code>showXxxDialog</code> methods shown below:
  74  * <blockquote>
  75  *
  76  *
  77  * <table border=1 summary="Common JOptionPane method names and their descriptions">
  78  * <tr>
  79  *    <th>Method Name</th>
  80  *    <th>Description</th>
  81  * </tr>
  82  * <tr>
  83  *    <td>showConfirmDialog</td>
  84  *    <td>Asks a confirming question, like yes/no/cancel.</td>
  85  * </tr>




  45 import java.io.IOException;
  46 import java.io.ObjectInputStream;
  47 import java.io.ObjectOutputStream;
  48 import java.io.Serializable;
  49 import java.lang.reflect.Method;
  50 import java.lang.reflect.InvocationTargetException;
  51 import java.security.AccessController;
  52 import java.security.PrivilegedAction;
  53 import java.util.Vector;
  54 import javax.swing.plaf.OptionPaneUI;
  55 import javax.swing.event.InternalFrameEvent;
  56 import javax.swing.event.InternalFrameAdapter;
  57 import javax.accessibility.*;
  58 import static javax.swing.ClientPropertyKey.PopupFactory_FORCE_HEAVYWEIGHT_POPUP;
  59 
  60 /**
  61  * <code>JOptionPane</code> makes it easy to pop up a standard dialog box that
  62  * prompts users for a value or informs them of something.
  63  * For information about using <code>JOptionPane</code>, see
  64  * <a
  65  href="http://docs.oracle.com/javase/tutorial/uiswing/components/dialog.html">How to Make Dialogs</a>,
  66  * a section in <em>The Java Tutorial</em>.
  67  *
  68  * <p>
  69  *
  70  * While the <code>JOptionPane</code>
  71  * class may appear complex because of the large number of methods, almost
  72  * all uses of this class are one-line calls to one of the static
  73  * <code>showXxxDialog</code> methods shown below:
  74  * <blockquote>
  75  *
  76  *
  77  * <table border=1 summary="Common JOptionPane method names and their descriptions">
  78  * <tr>
  79  *    <th>Method Name</th>
  80  *    <th>Description</th>
  81  * </tr>
  82  * <tr>
  83  *    <td>showConfirmDialog</td>
  84  *    <td>Asks a confirming question, like yes/no/cancel.</td>
  85  * </tr>