e**n 发帖数: 10 | 1 I have an UI,
three buttons in a North Pane, a TextPane at Central pane.
How can I force the textpane to get "focus" when the program initializes?
Thanks in advance |
xt 发帖数: 17532 | 2
Check requestFocus() methods
【在 e**n 的大作中提到】 : I have an UI, : three buttons in a North Pane, a TextPane at Central pane. : How can I force the textpane to get "focus" when the program initializes? : Thanks in advance
|
KG 发帖数: 515 | 3 requestFocus won't work until the component is actually shown. I believe the
first component you add to the Frame/Window/Dialog will gain focus initially,
or you can call requestFocus() in windowOpened in your window listener.
【在 xt 的大作中提到】 : : Check requestFocus() methods
|
xt 发帖数: 17532 | 4
There is another method to force the focus. However my question is: Why do you
want to focus on sth that is not shown?
【在 KG 的大作中提到】 : requestFocus won't work until the component is actually shown. I believe the : first component you add to the Frame/Window/Dialog will gain focus initially, : or you can call requestFocus() in windowOpened in your window listener.
|
e**n 发帖数: 10 | 5 You are right. It looks like that the first button gets the foucus.
Thanks
initially,
initializes?
【在 KG 的大作中提到】 : requestFocus won't work until the component is actually shown. I believe the : first component you add to the Frame/Window/Dialog will gain focus initially, : or you can call requestFocus() in windowOpened in your window listener.
|