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

JOptionPane showConfirmDialog returns incorrect value

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P3 P3
    • 6
    • 6
    • client-libs
    • None

      Run the below test case. It pops a JOptionPane confirm dialog. Using Tab key select
      2nd or 3rd button, returned value from showConfirmDialog is always 0.

      //begin test case

      import javax.swing.*;

      public class OptionPaneBug
      {
      public static void main (String [] args)
      {
        int i =
             JOptionPane.showConfirmDialog (null,
              "Press Tab to select different option, then press Enter key. ");

        System.out.println ("Selected value : " + i);
      }
      }
      // end test case

            shickeysunw Shannon Hickey (Inactive)
            rlingaiaorcl Ranjit Lingaiah (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: