Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4465519

Regression: JOptionPane.showInternal* broken in jdk1.4 beta

XMLWordPrintable

    • beta2
    • x86
    • solaris_2.5.1
    • Verified



      Name: boT120536 Date: 06/03/2001


      java version "1.4.0-beta"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-beta-b65)
      Java HotSpot(TM) Client VM (build 1.4.0-beta-b65, mixed mode)

      Compile and run the following test case:

      import javax.swing.*;

      public class Test {
          public static void main(String[] arg) {
           JFrame f = new JFrame();
              JDesktopPane desktop = new JDesktopPane();
              f.getContentPane().add(desktop);
           f.setBounds(100, 100, 550, 300);
              f.show();
           int result = JOptionPane.showInternalConfirmDialog(desktop, "Select an
      option");
          
           StringBuffer message = new StringBuffer("According to the return value,
      you clicked '");
           switch (result) {
           case JOptionPane.YES_OPTION: message.append("Yes"); break;
           case JOptionPane.NO_OPTION: message.append("No"); break;
           case JOptionPane.CANCEL_OPTION: message.append("Cancel"); break;
           default: message.append("<Unknown return value " + result
      + ">");
           }
           message.append("'");
           JOptionPane.showInternalMessageDialog(desktop, message);
           System.exit(0);
          }
      }

      Under JDK 1.3, it works perfectly. Under JDK 1.4 (on my Windows ME machine at
      least) it results in two very odd behaviors: first, the dialog uses a green
      theme, and second it always returns -1 (I presume this is from CLOSED_OPTION,
      which should be impossible because there isn't a close box on the internal
      dialog).
      (Review ID: 125381)
      ======================================================================

            joutwatesunw Joshua Outwater (Inactive)
            bonealsunw Bret O'neal (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: