Board index » jbuilder » how to set tab button to move focus between components

how to set tab button to move focus between components


2003-07-18 03:18:23 AM
jbuilder6
How would I set the tab button to move the focus from one component to the
next?
Also, how would I set a JButton to be 'pressed' when the enter button is
pressed?
Thanks!
 
 

Re:how to set tab button to move focus between components

On 7/17/2003 at 3:18:23 PM, Nechama Shuchatowitz wrote:
Quote
How would I set the tab button to move the focus from one component
to the next?
Assuming you mean the tab *key*, it should do that by default.
Quote
Also, how would I set a JButton to be 'pressed' when the enter button
is pressed?
Bind the Enter key. The JDK docs cover the Key Binding mechanism. You
can also find a copy here:
java.sun.com/j2se/1.4.2/docs/api/index.html
--
Regards,
John McGrath [TeamB]
 

Re:how to set tab button to move focus between components

In java , there is no "tab order", and the tab order in windows for java
application is same as the same order the component added to the container.
Jackloncon Chen
"Nechama Shuchatowitz" < XXXX@XXXXX.COM >写入消息新闻
: XXXX@XXXXX.COM ...
Quote
How would I set the tab button to move the focus from one component to the
next?
Also, how would I set a JButton to be 'pressed' when the enter button is
pressed?

Thanks!


 

{smallsort}

Re:how to set tab button to move focus between components

In swing, you can use setNextFocusableComponent to manual define tab order
one by one. this can not do "visible" like Delphi.
"Jacklondon Chen" < XXXX@XXXXX.COM >写入消息新闻
:3fdd1e08$ XXXX@XXXXX.COM ...
Quote
In java , there is no "tab order", and the tab order in windows for java
application is same as the same order the component added to the
container.

Jackloncon Chen

"Nechama Shuchatowitz" < XXXX@XXXXX.COM >д ?
: XXXX@XXXXX.COM ...
>How would I set the tab button to move the focus from one component to
the
>next?
>Also, how would I set a JButton to be 'pressed' when the enter button is
>pressed?
>
>Thanks!
>
>


 

Re:how to set tab button to move focus between components

Jacklondon Chen wrote:
Quote
In swing, you can use setNextFocusableComponent to manual define tab order
one by one. this can not do "visible" like Delphi.

No, you certainly do NOT use setNextFocusableComponent any more. It's
been deprecated since JDK 1.4 was released, so you should not be using
it in new code, and you should be replacing it in old code.
--
Regards,
Lori Olson (TeamB)
------------
Save yourself, and everyone else, some time and search the
newsgroups and the FAQ-O-Matic before posting your next
question.
Google Advanced Newsgroup Search
www.google.ca/advanced_group_search
Other Newsgroup Searches:
www.borland.com/newsgroups/ngsearch.html
Joi Ellis's FAQ-O-Matic:
www.visi.com/~gyles19/fom-serve/cache/1.html
 

Re:how to set tab button to move focus between components

You can use DefaultFocusTraversalPolicy, but I don't like it.
This make simple thing complex.
"Lori M Olson (TeamB)" < XXXX@XXXXX.COM >
??????:3fdf34ef$ XXXX@XXXXX.COM ...
Quote
Jacklondon Chen wrote:

>In swing, you can use setNextFocusableComponent to manual define tab
order
>one by one. this can not do "visible" like Delphi.
>

No, you certainly do NOT use setNextFocusableComponent any more. It's
been deprecated since JDK 1.4 was released, so you should not be using
it in new code, and you should be replacing it in old code.

--

Regards,

Lori Olson (TeamB)

------------

Save yourself, and everyone else, some time and search the
newsgroups and the FAQ-O-Matic before posting your next
question.

Google Advanced Newsgroup Search
www.google.ca/advanced_group_search
Other Newsgroup Searches:
www.borland.com/newsgroups/ngsearch.html
Joi Ellis's FAQ-O-Matic:
www.visi.com/~gyles19/fom-serve/cache/1.html