-
Bug
-
Resolution: Duplicate
-
P4
-
None
-
1.4.2
-
x86
-
windows_2000
Name: dk106046 Date: 10/30/2003
This problem is only there in Japanese version Windows using Japanese input mode (set "INPUT LOCALE" called IME2000) and not on English machines.
To reproduce the problem (using JDK 1.4.2_02):
1. Execute the Applet ( which contains a textfield and a button ) under the control of Internet Explorer.
2. Minimize the window in which Applet is active, then restore the window. This action may need to be repeated several times before the the textfield becomes uneditable. This problem is only there in Japanese version Windows using Japanese input mode (set "INPUT LOCALE" called IME2000) and not on English machines.
FocustTest.java:
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class FocusTest extends JApplet{
class TestField extends JTextField implements FocusListener, KeyListener {
TestField(String name){
super(name);
addFocusListener(this);
addKeyListener(this);
}
public void focusGained(FocusEvent e){
System.out.println("Gained");
repaint();
}
public void focusLost(FocusEvent e){
System.out.println("Lost");
}
public void keyPressed(KeyEvent e) { System.out.println("KeyPressed"); }
public void keyReleased(KeyEvent e) { System.out.println("KeyReleased"); }
public void keyTyped(KeyEvent e) { System.out.println("KeyTyped"); }
}
JButton button = new JButton("myButton");
TestField field = new TestField("myField");
JPanel pnl = new JPanel();
public void init(){
System.out.println("init\n");
setBackground(Color.blue);
button.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
field.requestFocus();
}
});
pnl.add(field);
pnl.add(button);
pnl.setBackground(Color.pink);
Container contentPane = getContentPane() ;
contentPane.add(pnl);
}
public void start(){
System.out.println("Start\n");
}
public void run(){
System.out.println("run\n");
requestFocusInWindow();
}
}
Test.html:
<APPLET code="FocusTest.class" WIDTH=200 HEIGHT=200>
</APPLET>
Observations:
1. Bug 4352005 may be relevant: when a window is activated in Japanese NT, the time between the arrival of the WM_ACTIVATE and the WM_SETFOCUS events is longer than in English NT. This change of timing messes up the order of the components which are getting focus.
2. Bug 4264635 may be relevant.
3. Also we have made an interesting observation that when we attach IE to spy++ and when we launch the applet using the same IE window, then it looks like problem is not re-creatable and seems to work fine. Therefore, we suspect that this could be a timing issue.
======================================================================
- duplicates
-
JDK-4877530 Unable to input text into JTextField in 1.4.1_02
- Resolved