Skip to main content

Next Tab Please

Posted by gsporar on October 10, 2007 at 6:35 AM PDT

In the screen shot below, I have three source files open in the editor and each has its own tab.


For a long time now, the NetBeans IDE has provided an easy way to move between the tabs: hold down the Ctrl key and then press the Tab key. You get a little popup that looks like this:


Continue to press the Tab key until the file you want is selected and then let go of the Ctrl key and the IDE will switch focus to that file's tab. Simple enough and very convenient.

One of the things that got some attention in the upcoming NetBeans IDE 6 release is keyboard short cuts, which is nice because I do not like to take my fingers off the keyboard. I stumbled across a couple of new short cuts earlier today: Ctrl-PageUp and Ctrl-PageDown. They are similar to the existing Ctrl-Tab but instead of displaying a list of the files, they just take switch focus to the next tab to the right (Ctrl-PageDown) or to the left (Ctrl-PageUp). One additional thing I like is that they wrap. In other words, pressing Ctrl-PageDown on the furthest tab to the right will set focus to the first tab on the left.

Update: A comment from grimlock81 indicates that this feature did exist in previous versions of NetBeans: Ctrl-Left arrow and Ctrl-Right arrow. In investigating further, it appears to me grimlock81 is close, but not quite correct. Using NetBeans 5.5, the default keystrokes are actually Alt-Left arrow and Alt-Right arrow.

So why didn't I spot that? Two reasons: this feature is not as easy to discover as I might like and the keymap entry moved in NetBeans 6. In NetBeans 5.5 the entries in the Options dialog's Keymap list for Previous Tab and Next Tab were under the "Go To" category. In NetBeans 6 they have been moved to the "Window/Select Document in" sub-category of the "Window" category: