Changing Keyboard Shortcuts, Fonts, and Colors

Changing Keyboard Shortcuts, Fonts, and Colors

You can change default keyboard shortcuts or map other available commands to shortcuts. If you are familiar with keyboard shortcuts defined in other IDEs, you can choose to use those instead of the defaults provided by NetBeans IDE.

Moreover, if you are comfortable with fonts and colors in other IDEs or editors, or for some reason you don’t like the default colors used in the editor or in the IDE as a whole, you can relatively easily switch to your preferred font and color combinations.

To modify keyboard shortcuts, choose Options from the Tools menu. When the Options window opens, click the Keymap panel. In the Actions list, navigate to an action that you want to change, click the ellipsis button, and click Edit. Type in the keyboard shortcut that you want to use and press Enter.

As shown in Figure 3-7 , the IDE comes with keyboard shortcut profiles for Eclipse, IntelliJ IDEA, and Emacs, any of which you can select from the Profiles dropdown box in the Keymap panel. You can also create your own profiles.

Figure 3-7. Switching Keymap profiles in the Options window

To modify the fonts and colors of the Source Editor, choose Options from the Tools menu. When the Options window opens, click the Fonts & Colors panel, as shown in Figure 3-8 . Choose a profile from the Profile dropdown box. If you want to fine-tune a profile, use the Category list to navigate to a class member that you want to modify, and then use the Font, Foreground, Background, Effects, and Effect Color components as needed. Use the Preview area to make sure you have customized according to your requirements. Then press Enter.

Figure 3-8. Switching Fonts & Colors profiles in the Options window

For example, if you select Norway Today from the Profile dropdown without making any further changes, the editor will look as shown in Figure 3-9 .

Figure 3-9. “Norway Today” Font and Color profile

Go to the following URL to design and download your own themes: http://netbeansthemes.com . Nowadays, dark backgrounds are increasingly popular in development tools. You can switch to a dark

background throughout the IDE by installing the Dark Look & Feel Themes plugin.

To do so, choose Plugins from the Tools menu. When the Plugin Manager opens, click the Available Plugins panel. Select and install the Dark Look and Feel Themes plugin, as shown in Figure 3-10 .

Figure 3-10. Dark Look and Feel Themes plugin

After installing the plugin and restarting the IDE, the IDE looks as shown in Figure 3-11 .

Figure 3-11. Dark Metal look and feel

However, the plugin provides two different dark themes. Moreover, various other themes are provided by default, defined by Swing “Look & Feel” implementations.

To switch between themes, choose Options from the Tools menu. When the Options window opens, click the Appearance panel, as shown in Figure 3-12 . Use the Preferred Look and Feel dropdown to switch themes.

Figure 3-12. Switching between look and feels in the Options window

After switching themes to Dark Nimbus and restarting the IDE, it looks as shown in Figure 3-13 .

Figure 3-13. The Dark Nimbus look and feel