P
Pierre
Hello,
I have a JDialog with a JTextField in my application. When I show the
dialog, I want the JTextField to grab focus. Very simple... but my
code doesn't work! the first time I show the dialog the textfield has
focus, but after it lost it. here an extract of my code :
public MyDialog(){
super("test");
init();
//search is my JTextField
search.grabFocus();
}
public void show(){
update();
search.grabFocus();
super.show();
}
Any idea why this code doesn't work properly ?
Thanks.
Pierre.
I have a JDialog with a JTextField in my application. When I show the
dialog, I want the JTextField to grab focus. Very simple... but my
code doesn't work! the first time I show the dialog the textfield has
focus, but after it lost it. here an extract of my code :
public MyDialog(){
super("test");
init();
//search is my JTextField
search.grabFocus();
}
public void show(){
update();
search.grabFocus();
super.show();
}
Any idea why this code doesn't work properly ?
Thanks.
Pierre.