Other | Other |
---|---|
1.4.1_03 03Fixed | 1.4.2Fixed |
Duplicate :
|
|
Relates :
|
|
Relates :
|
|
Relates :
|
If a Window is set to unfocusable by Window.setFocusableWindow(false), any action, e.g., clicking on the window to try to give it focus, should not generate any focus event by that action, and the focus should remain in the same component that has focus previously. One of the requesters of setFocusableWindow is the Input Method Framework, and due to this problem, IMF needs to add some workaround. naoto.sato@Eng 2001-04-30 Name: rpR10076 Date: 08/02/2001 The following testcase can be used to demonstrate the problem: import java.awt.*; import java.awt.event.*; public class Test { public static void main(String[] args) { Frame frame; Window window; Button button1; Button button2; frame = new Frame("test"); button1 = new Button("button1"); button1.addFocusListener(new MyFocusListener()); button2 = new Button("button2"); frame.setSize(200, 200); frame.setLocation(200, 200); frame.add(button1); window = new Window(frame); window.setSize(100, 100); window.setFocusableWindowState(false); window.add(button2); frame.setVisible(true); window.setVisible(true); } } class MyFocusListener implements FocusListener { public void focusGained(FocusEvent evt) { System.out.println("Focus gained"); } public void focusLost(FocusEvent evt) { System.out.println("Focus lost"); } } ======================================================================
|