Setting Fonts and Colors in the Source Editor

See Also

You can customize the font, background color, and foreground color for many categories of text in the Source Editor. Every type of editor can have different font and color settings. You can also set font and color settings for printing.

You can also create different profiles of fonts and colors. The IDE provides the default NetBeans profile and the City Lights profile. The City Lights profile provides a black background behind the text.

The categories of text that can be customized include:

To set fonts and colors for text:

  1. Choose Tools > Options.
  2. Click Fonts & Colors in the left pane of the Options window.
  3. In the right pane, click the Syntax tab.
  4. Choose an editor type from the Language drop-down list and then select a Category.
  5. Select a font by clicking the ellipsis (...) button and selecting a font from the Font Chooser dialog box.
  6. Select foreground and background colors from the drop-down list.

    To specify a color not contained in the list, choose Custom from the drop-down list to open the Select Color dialog box.

  7. Select an effect to apply to the selected text category, if desired.
  8. Click OK to apply the changes.

    The Preview pane displays how the applied changes will appear in the Source editor.

To switch font and color profiles:

  1. Choose Tools > Options.
  2. Click Fonts & Colors in the left pane of the Options window.
  3. In the right pane, select a profile from the Profiles drop-down list.

To create a new font and color profile:

  1. Choose Tools > Options.
  2. Click Fonts & Colors in the left pane of the Options window.
  3. In the right pane, select the profile that most resembles the profile that you want to create.
  4. Click Duplicate.
  5. Make the desired customizations to the new profile.

To set colors for editor elements:

  1. Choose Tools > Options.
  2. Click Fonts & Colors in the left pane of the Options window.
  3. In the right pane, click the Highlighting tab.
  4. Select a Category.
  5. Select foreground and background colors from the drop-down list.

    To specify a color not contained in the list, choose Custom from the drop-down list to open the Select Color dialog box.

  6. Select an effect to apply to the selected category, if desired.
  7. Click OK to apply the changes.

    The Preview pane displays how the applied changes will appear in the Source editor.

To set colors for annotations:

  1. Choose Tools > Options.
  2. Click Fonts & Colors in the left pane of the Options window.
  3. In the right pane, click the Annotations tab.
  4. Select a Category.
  5. Select foreground and background colors from the drop-down list.

    To specify a color not contained in the list, choose Custom from the drop-down list to open the Select Color dialog box.

  6. Select an effect to apply to the selected category, if desired.
  7. Click OK to apply the changes.

To set fonts and colors for printing:

  1. Choose Tools > Options and click Advanced Options.
  2. Expand IDE Configuration > System > Print Settings and select and editor type.
  3. In the right pane, click the ellipsis (...) button in the Print Fonts and Colors property.
  4. In the Print Fonts and Colors property editor, select an element from the Syntax list. Then use the controls in the right side of the dialog box to set the font, foreground color, and background colors.
  5. Click OK to apply the changes and close the dialog box.
See Also
Options Window: Print Properties
Sharing Source Editor Settings
Importing Settings from a Previous Version of the IDE

Legal Notices