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

Swing apps take input focus on launch regardless of window manager policy

    Details

    • Type: Bug
    • Status: Open
    • Priority: P3
    • Resolution: Unresolved
    • Affects Version/s: solaris
    • Fix Version/s: None
    • Component/s: client-libs
    • Labels:
    • Subcomponent:
    • CPU:
      generic
    • OS:
      solaris_nevada

      Description

      [dep, 02May2007]

        I've noticed that on recent builds, regardless of window manager
        settings to the contrary, swing applications take input focus
        immediately on startup. This is really annoying behavior, especially
        if I'm in the middle of typing something sensitive in the window that
        looses focus.

        Setting AWT_TOOLKIT=MToolkit makes the problem go away. (At least on
        SPARC; on x86 I get font errors which ultimately result in an NPE).

        A simple test program which exhibits the problem:

              import javax.swing.*;

              public class Test implements Runnable
              {
                      public static void main(String args[])
                      {
                              SwingUtilities.invokeLater(new Test());
                      }

                      public synchronized void run()
                      {
                              assert (SwingUtilities.isEventDispatchThread());

                              JFrame frame = new JFrame("Test");
                              frame.add(new JLabel("Hello World"));

                              frame.pack();
                              frame.setVisible(true);
                      }
              }

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                ant Anton Tarasov
                Reporter:
                duke J. Duke (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Imported:
                  Indexed: