-
Bug
-
Resolution: Cannot Reproduce
-
P4
-
None
-
1.2.0
-
sparc
-
solaris_2.6
Run the test case below and notice that after the frame shows on the screen initially none of the buttons has the focus although it was requested by requestFocus() that the right button does. After using TAB at least once, the buttons start to accept focus. This works fine on Win32.
import com.sun.java.swing.*;
import java.awt.event.*;
public class TestApp extends JFrame
{
public TestApp() {
super("TestApp");
this.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent ev) {
System.exit(0);
}
});
JButton but1 = new JButton("not focused");
JButton but2 = new JButton("focused");
this.getContentPane().add("West", but1);
this.getContentPane().add("East", but2);
this.pack();
this.setVisible(true);
but2.requestFocus();
}
static public void main(String args[]) {
new TestApp();
}
}
import com.sun.java.swing.*;
import java.awt.event.*;
public class TestApp extends JFrame
{
public TestApp() {
super("TestApp");
this.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent ev) {
System.exit(0);
}
});
JButton but1 = new JButton("not focused");
JButton but2 = new JButton("focused");
this.getContentPane().add("West", but1);
this.getContentPane().add("East", but2);
this.pack();
this.setVisible(true);
but2.requestFocus();
}
static public void main(String args[]) {
new TestApp();
}
}