Setting Tab Behavior

See Also

By default, the IDE converts all tabs that you type into the Source Editor into spaces. Any tab characters (\t) that already exist in a file remain unless you use the Reformat Code command on the file.

You can customize the IDE in the following ways:

Three settings determine how tabs are handled by the Source Editor:

To modify the tab settings for Java files:

  1. Choose Tools > Options, click Editor, and select the Indentation tab.
  2. Adjust the values of the Expand Tabs to Spaces and Number of Spaces per Indent options.

To modify the tab settings for non-Java files:

  1. Choose Tools > Options and click Advanced Options.
  2. Expand Editing > Indentation Englines and select the type of editor you are using.
  3. Adjust the values of the Expand Tabs to Spaces and Number of Spaces per Indent settings.

    See Options Window: Indentation Engines for a complete description of these settings.

Converting Existing Tab Characters to Spaces

By default, the Source Editor converts tabs to spaces as you are typing code. If you have code that you created outside of the IDE and that code has tab characters in it, you can convert those tab characters to spaces by using the IDE's Reformat Code command.

To convert existing tab characters to spaces:

See Also
Formatting Code

Legal Notices