JOptionPane showConfirmDialog returns incorrect value

XMLWordPrintable

    • Type: Bug
    • Resolution: Not an Issue
    • Priority: P3
    • 6
    • Affects Version/s: 6
    • Component/s: 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

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

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: