Hi,
I have an
applet which pops a JDialog which has one JTextField, one JPasswordField and two buttons. By default JTextField should have the focus and for that I code like this:
SwingUtilities.invokeLater(new FocusRequestor(comp));
class FocusRequestor extends
Thread {
private Component component;
FocusRequestor(Component c) {
component = c;
}
public void run() {
if (component.getParent() != null) {
component.requestFocusInWindow();
}
}
}
Now the problem is its working fine with jre 1.5 but with jre 1.6, I am not getting the focus all time. If I ALT+TAB to another window and then come back to my dialog then I am getting the focus.
Can anyone help me? Is this a problem with
java 1.6.
I am using jre1.6.0_07 and IE7 when its working fine with jre 1.5.0_09.
Thanks in advance.
Barun.