-
Bug
-
Resolution: Not an Issue
-
P4
-
None
-
1.0.2
-
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();
}
}
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();
}
}