Tuesday Dec 13, 2005

Quickly Navigating between files in NetBeans

Been a few days since I started the "increasing Java developer productivity with NetBeans" series.

I suspect there are some new NetBeans users who want to know how to quickly navigate between files they have open in the NetBeans IDE editor, especially when they have many files open, or the file name lengths are pretty long and the file name tabs at the top of the editor window quickly use up the available space.

This blog describes ways to quickly navigate between open files in the NetBeans IDE.

There are a couple options to quickly navigate between files. If you're a point and click kinda user, you can select "Window | Documents" from the NetBeans IDE main menu. If you're a key stroke kinda user, you can press "Shift-F4". In either case you're presented with a list of documents/files you have open in the editor. Here's a screen shot of that dialog.


Once you have this dialog in front of you, again if you are point and click kinda user, you can click on the file you want to view in the editor. If you are a key stroke kinda user, just start typing the name of the file you want to load in the editor. NetBeans will automatically pop-up a quick search dialog and begin to match a file name with the string you have entered. For example, I have a file named AppLaunchAction.java loaded in the NetBeans editor and I want to quickly navigate to a file named Component3DGroupMigrationAction.java. I can bring up the Documents dialog with Shift-F4 and begin typing 'Co' and the file named Component3DGroupMigrationAction.java is immediately selected. You can see this in the screen shot below:


As soon as the file you want to navigate too is selected, you can press <Enter> to view it in the editor.

If you do not want to use the Documents dialog above, you can also move back forth between open files that pressing <Alt-right-arrow> and <Alt-left-arrow>. This too is a rapid way of migrating between files in the editor.

Enjoy!

Comments:

You forgot to mention <Ctrl>-<Tab> to navigate open file in "previous file viewed" order.

Posted by Hugues Ferland on December 14, 2005 at 12:43 PM CST #

Oups... I meant <Ctrl>-<Tab> of course

Posted by Hugues Ferland on December 14, 2005 at 12:45 PM CST #

Hi Charlie. Another option that I kind of like beter than using Alt-right-arrow and Alt-left-arrow is to just hold down the Ctrl key and then press Tab. That displays a little dialog box that is sort of a shortcut for Alt arrow keys functionality; it lists all the open windows. In other words, continuing to press Tab will cycle through the entries, when you let go the entry that is selected will be the window that gets focus.

Posted by Gregg Sporar on December 14, 2005 at 05:03 PM CST #

Related to Gregg's tip to use ctrl+tab, that doesn't works for linux, because ctrl+tab is used to go to the next workplace, so I use alt+arrow (left or right).

Posted by Claudio Miranda on December 15, 2005 at 02:02 PM CST #

Post a Comment:
Comments are closed for this entry.