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

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

XMLWordPrintable

    • beta3
    • x86
    • windows_nt
    • Verified



      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.
      ###@###.###
      ======================================================================

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

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: