由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Java版 - A "Focus" question
相关主题
问个swing login窗口的问题Ant and Netbeans help
JavaFX那个透明着色的问题现在居然这样了!swing question
Re: FileDialog 的问题Pls help how to open a dialog or frame?
Re: 如何在两个窗口之间通信?Interview Questions in Core Java
Servlet question: the orig filenamea wired problem about JRE for IE,Thanks
新手一问如何改变JDK 的语言设置
design questionSun 的applet warning for each new window害死我了
How to wrap line at specific position?eclipse有没有update变量名称的功能?
相关话题的讨论汇总
话题: focus话题: textpane话题: pane话题: question
进入Java版参与讨论
1 (共1页)
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.

1 (共1页)
进入Java版参与讨论
相关主题
eclipse有没有update变量名称的功能?Servlet question: the orig filename
Any testNG gui exist?新手一问
请问用eclipse开发中文的软件design question
有人用 textpad 编辑 .java文件吗?How to wrap line at specific position?
问个swing login窗口的问题Ant and Netbeans help
JavaFX那个透明着色的问题现在居然这样了!swing question
Re: FileDialog 的问题Pls help how to open a dialog or frame?
Re: 如何在两个窗口之间通信?Interview Questions in Core Java
相关话题的讨论汇总
话题: focus话题: textpane话题: pane话题: question