JDK-4946379 : Textfield becomes uneditable after window is minimized
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt:i18n
  • Affected Version: 1.4.2
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_2000
  • CPU: x86
  • Submitted: 2003-10-30
  • Updated: 2003-10-31
  • Resolved: 2003-10-31
Related Reports
Duplicate :  
Description

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.


======================================================================

Comments
EVALUATION Tried to reproduce the problem, but so far I could not. ###@###.### 2003-10-30 It turned out that the problem seems not reproducible on the latest Tiger build, while it *is* reproducible on 1.4.2. ###@###.### 2003-10-31 The problem mentioned in this bug is exactly the same as the one in 4915979, which is already closed as a duplicate of 4877530. ###@###.### 2003-10-31
31-10-2003