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

Win32: creating a Frame causes the current focus to be lost.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P4 P4
    • None
    • 1.0.2
    • client-libs
    • generic
    • windows_95

      I noticed that creating a Frame (not showing it) on the PC
      causes the current focus to be lost. This has really annoying
      side effects. Below is an example.

      --

      import java.awt.*;
      import java.awt.image.*;

      public class Test extends Frame {
          public void paint(Graphics g) {
      g.drawString("Click me and I will lose the focus", 10, 30);
          }

          public boolean handleEvent(Event evt) {
      switch (evt.id) {
      case Event.MOUSE_DOWN:
      System.out.println("MOUSE DOWN");
      Frame frm = new Frame();
      frm.addNotify();
      return true;

      case Event.KEY_PRESS:
      System.out.println("KEY: " + evt.key);
      return true;
      }
      return super.handleEvent(evt);
          }

          public static void main(String argv[]) {
      Test t = new Test();
      t.reshape(50, 50, 400, 200);
      t.show();
      t.requestFocus();
          }
      }

            rramsunw Ranganathan Ram (Inactive)
            tballsunw Tom Ball (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: