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

REGRESSION: JOptionPane.showMessageDialog() doesn't have "OK" button focused by

    Details

    • Subcomponent:
    • Resolved In Build:
      beta3
    • CPU:
      x86
    • OS:
      windows_nt
    • Verification:
      Verified

      Description



      Name: biR10147 Date: 08/31/2001

      When JOptionPane.showMessageDialog() is invoked, "OK" button doesn't have a focus. Clicking on "Tab", however, gives the focus to the button, and from now on focus traverses correctly. This is a regression. In beta2-b78 focus sets correctly.

      To reproduce it, compile and run the test case below:

      ===================================================

      import java.awt.Frame;
      import javax.swing.JOptionPane;

      public class FocusTest extends Frame {

          public FocusTest() {
              JOptionPane.showMessageDialog(null, "Does the button have a focus?",
                  "Am I focused?", JOptionPane.QUESTION_MESSAGE);
          }

          public static void main(String[] args) {
              (new FocusTest()).setVisible(true);
          }
      }

      ===================================================

      On Solaris everything behaves correctly.

      ###@###.###

      Workaround: Traverse focus manually or programmatically after showing a modal dialog.
      ###@###.###
      ======================================================================

        Attachments

          Activity

            People

            • Assignee:
              dmikhalksunw Denis Mikhalkin (Inactive)
              Reporter:
              ibdsunw Ibd Ibd (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Imported:
                Indexed: