Skip to main content

Newbie question: how to switch tabs when Ctrl+Tab is pressed

14 replies [Last post]
jacek
Offline
Joined: 2003-08-22

One of the things I miss most in Swing is that tab controls don't seem to behave the standard way as other Windows apps do.

When pressing Ctrl+Tab in the current tabbed pane, I am expecting to have it make the next available tab current.

Instead it just seems to move focus around. What would be the best way to change this behaviour to be more in sync with how a Windows user expects it to behave?

thanks in advance for any tips,

Jacek

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
viravan
Offline
Joined: 2003-06-23

WordApi.exe???

Sorry, don't even know what it is until now. You'll have better luck sending an e-mail to the developer of this product -- see link shown below:

http://www.must.de/default.html?Javactpe.htm

;o)

V.V.

viravan
Offline
Joined: 2003-06-23

WordApi.exe???

Sorry, don't even know what it is until now. You'll have better luck sending an e-mail to the developer of this product -- see link shown below:

http://www.must.de/default.html?Javactpe.htm

;o)

V.V.

viravan
Offline
Joined: 2003-06-23

WordApi.exe???

Sorry, don't even know what it is until now. You'll have better luck sending an e-mail to the developer of this product -- see link shown below:

http://www.must.de/default.html?Javactpe.htm

;o)

V.V.

viravan
Offline
Joined: 2003-06-23

WordApi.exe???

Sorry, don't even know what it is until now. You'll have better luck sending an e-mail to the developer of this product -- see link shown below:

http://www.must.de/default.html?Javactpe.htm

;o)

V.V.

viravan
Offline
Joined: 2003-06-23

WordApi.exe???

Sorry, don't even know what it is until now. You'll have better luck sending an e-mail to the developer of this product -- see link shown below:

http://www.must.de/default.html?Javactpe.htm

;o)

V.V.

viravan
Offline
Joined: 2003-06-23

WordApi.exe???

Sorry, don't even know what it is until now. You'll have better luck sending an e-mail to the developer of this product -- see link shown below:

http://www.must.de/default.html?Javactpe.htm

;o)

V.V.

viravan
Offline
Joined: 2003-06-23

Sorry for so many duplicate posting but this forum software needs to be fixed!

Message was edited by: viravan

viravan
Offline
Joined: 2003-06-23

Sorry for so many duplicate posting but this forum software needs to be fixed!

Message was edited by: viravan

hetal0713
Offline
Joined: 2006-02-17

Hi Viravan,

I got your ID from one of the discussion forum of Java. Looking at your
forum threads , it seems that you have worked previously on "WordAPI.exe"
which is used for communicating with Microsoft Word.
Myself is hetal and i am a software developer in software company in INDIA.
Our requirement is to read a word document using java program and write the
content of the word document on browser. I have downloaded the WordAPI.exe
file but i dont know how to use it. Can u please breif me about its usage
and i would appreciate if you can send me the sample files in which u have
used API of this.

looking for a favourable reply
Thanks in advance..
bye
Hetal

viravan
Offline
Joined: 2003-06-23

Sorry for so many duplicate posting but this forum software needs to be fixed!

Message was edited by: viravan

holm
Offline
Joined: 2005-04-13

It's a bug 4736672 and it was fixed in 1.5. The fix resolves out the conflict with the focus traversal keys and corrects the method navigateSelectedTab in BasicTabbedPaneUI.

uncle_alice
Offline
Joined: 2003-06-16

Yeah, I figured you would catch the second bug in the process of fixing the conflict, but I wanted to be sure. Thanks for the feedback.

viravan
Offline
Joined: 2003-06-23

I have JTables in a JTabbedPane and the way I do it is to disable these keys altogether in my JTables and just trap and process these keys myself. In 1.4, you can try this:

[code]
setFocusTraversalKeys(KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS,Collections.EMPTY_SET); // disable TAB/Ctrl-TAB
setFocusTraversalKeys(KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS,Collections.EMPTY_SET); // disable Shift-TAB/Shift-Ctrl-TAB
[/code]

;o)

V.V.

uncle_alice
Offline
Joined: 2003-06-16

Actually, JTabbedPane [i]is[/i] supposed to work that way, but there are two bugs that prevent it from doing so. One is the conflict with the focus traversal keys that viravan pointed out, and the other is in the method navigateSelectedTab(int direction) in BasicTabbedPaneUI. I reported the latter about a month ago, but haven't received confirmation yet. The review ID is 192713, in case any Sun engineers reading this feel like checking up on it. ;)