The Source for Java Technology Collaboration
User: Password:



Gregg Sporar

Gregg Sporar's Blog

Next Tab Please

Posted by gsporar on October 10, 2007 at 06:35 AM | Comments (8)

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

tone.png

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:

ttwo.png

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:

toptions.png

Bookmark blog post: del.icio.us del.icio.us Digg Digg DZone DZone Furl Furl Reddit Reddit
Comments
Comments are listed in date ascending order (oldest first) | Post Comment

  • viex has implemented at first . http://viex.sourceforge.net

    Posted by: yin_nai on October 09, 2007 at 05:07 PM

  • The shortcuts were Ctrl-left arrow and Ctrl-right arrow in NB 5.

    Posted by: grimlock81 on October 09, 2007 at 10:09 PM

  • @grimlock81: I have updated the entry - thanks!

    Posted by: gsporar on October 10, 2007 at 06:36 AM

  • I have started playing with NB6 and I can't figure out why the default short cuts have changed from CTRL+left/right arrow to CTRL + pgup/down. Seems to me, that the cursor keys are much more reachable than PgUp/Down. Thus making tab switching easier in NB5 over NB6 (imho). I could understand it if in NB6 CTRL + arrow keys were put to good use, but no. Change for no apparent reason. Peter.

    Posted by: phenderson on October 11, 2007 at 10:57 AM

  • On an unrelated topic, does any one know how to get search members in NetBeans? In Eclipse there is the Ctrl + O shortcut, but seem to find anything similar for NetBeans..

    Posted by: rahulpilani on October 11, 2007 at 03:24 PM

  • @gregg: Oops, thanks for fixing it. @Peter: Assign your own keymap if you preferred the old method. @rahulpilani: For NB6, Ctrl + F12

    Posted by: grimlock81 on October 11, 2007 at 10:31 PM

  • I work in GlassFish application server team. Please let me know how to view Java methods in Netbeans 6

    Posted by: gfbugbridge on October 12, 2007 at 07:07 PM

  • @gfbugbridge: I'm not sure I understand your question.... There are a number of different navigation windows available. Press Ctrl-7 to open the Navigator, which shows all methods in the current file. Or put the cursor on any class reference and then press Ctrl-Shift-F12 to bring up the Members popup dialog.

    Posted by: gsporar on October 16, 2007 at 01:17 PM





Powered by
Movable Type 3.01D
 Feed java.net RSS Feeds