(Sun bug #6646582)
Summary: Focus is not set for TextFields in Java applets in some environments. Initially this was noted in Firefox 3, but now the same problem has been reproduced in one instance in Firefox 2 and Internet Explorer 7, so it does not seem specific to Firefox 3 and Firefox bug # 409209 has been withdrawn. However, the Sun part of the bug seems to still be a bug, but it may be related to Focus Problem that Began with Java 1.7 build 17, though it doesn't completely overlap with that bug in some browser and Java VM combinations. Investigating the details is hampered currently by the lack of availability of Java 1.7 builds before build 19. I asked for access again to Java 1.7 build 16 and was given a URL but unfortunately this previously available material is now rated as so secret that I am not allowed access to it. I get a message "Your account does not have the "VersionControl - Read" permission needed for you to access the page".
Steps to Reproduce:
1.
Make sure the browser has Java installed.
2. In the applet displayed on this page, click the purple area to make the
applet active.
3. Look for a cursor in the TextField and type some text.
Actual Results: Using Firefox 3 beta 2 (or 3 or 4, and for some Java VM versions, Firefox 2 and Internet Explorer) no cursor appears and typed text does not appear in the TextField unless the TextField is selected manually.
Expected Results: Using some Java versions such as 1.7 build 24 and Firefox 2.0.0.11, a cursor appears and typed text appears in the TextField as expected.
Additional information:
1. Testing was done using Windows Vista
2. If the TextField is selected manually it has focus, even when the page is
refreshed, but after going off to another page and returning the focus is gone
again.
Notes: If you have any insights, workarounds or comments about
this test page please contact Mickey
Segal. A listing of many Java resources is at this link.
import java.awt.*;
import java.applet.*;
public class TextFieldFocus extends Applet {
public void init()
{
setBackground(new Color(240, 220, 255));
TextField tf = new TextField(15);
add (tf);
tf.requestFocus();
}
} // END OF Class TextFieldFocus