FileDocCategorySizeDatePackage
JOptionPaneDemonstrationLocalized.javaAPI DocExample2214Wed Jan 17 20:10:44 GMT 2001None

JOptionPaneDemonstrationLocalized

public class JOptionPaneDemonstrationLocalized extends Object

Fields Summary
Constructors Summary
Methods Summary
public static voidmain(java.lang.String[] argv)


    GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
    Font unicodeFont = new Font("LucidaSans", Font.PLAIN, 12);

    ResourceBundle bundle =
        ResourceBundle.getBundle("JOptionPaneResources", Locale.getDefault());
    if (bundle == null)
      System.exit(1);

    String [] textMessages = new String[3];
    textMessages[0] = bundle.getString("Yes");
    textMessages[1] = bundle.getString("No");
    textMessages[2] = bundle.getString("Cancel");

    JOptionPane jop =
        new JOptionPane(bundle.getString("MessageText"),
                        JOptionPane.ERROR_MESSAGE,
                        JOptionPane.YES_NO_CANCEL_OPTION,
                        null, textMessages);
    JDialog jopDialog = jop.createDialog(null, bundle.getString("TitleText"));
    jop.setFont(unicodeFont);
    jopDialog.show();
    Object userSelection = jop.getValue();
    // NOTE: The return value returned by the above statement is an int
    System.exit(0);