1

Is there a way to change the editor's line height in Netbeans without resorting to redundant newlines?

4 Answers 4

5

For netbeans 7.2.x on Windows 7, the location is slightly different (but can be found without too much digging).

%USERPROFILE%\AppData\Roaming\NetBeans\7.2.1\config\Editors\Preferences\org-netbeans-modules-editor-settings-CustomPreferences.xml

And then, as others have mentioned, above, add the following at the end (but before the </editor-preferences> closing tag:

<entry javaType="java.lang.Float" name="line-height-correction" xml:space="preserve">
    <value><![CDATA[1.5]]></value>
</entry>

Note that here, the actual line-spacing value is 1.5 which means 1.5 x the default line-spacing, i.e.: 150%.

3

Expanding on gulbandr's answer:

For Netbeans 6.8 and above on Windows, change some arbitrary setting under "Tools/Options/Editor" to trigger the creation of a configuration file. It gets created at

%USERPROFILE%\.netbeans\6.8\config\Editors\Preferences\org-netbeans-modules-editor-settings-CustomPreferences.xml

Then add the following lines into the <editor-preferences> element:

<entry javaType="java.lang.Float" name="line-height-correction" xml:space="preserve">
    <value><![CDATA[1.5]]></value>
</entry>
2

The file org-netbeans-modules-editor-settings-CustomPreferences.xml can be found in {install_dir}\ide\config\Modules. If it’s not there, change any editor settings in NetBeans IDE, and it’ll create it.

Open this file in your favourite text editor, and add the following code right before the last line (right before the </editor-preferences> tag):

<entry javaType="java.lang.Float" name="line-height-correction" xml:space="preserve">
    <value><![CDATA[0.7]]></value>
</entry>

Then restart NetBeans.

source

4
  • For Netbeans 6.9.1 that's not entirely accurate.
    – Saul
    Nov 5, 2010 at 13:40
  • Indeed. You answer seems better.
    – gulbrandr
    Nov 5, 2010 at 14:28
  • gulbandr's answer worked as expected in Netbeans 7.1.1 in Mac OSX Lion.
    – Santhosh
    Jul 17, 2012 at 7:18
  • If on Mountain Lion for NetBeans >= 7.2.1 you fail find the file org-netbeans-modules-editor-settings-CustomPreferences.xml in the suggested directory, have a look in ~/Library/Application Support/NetBeans/7.2.1/config/Editors/Preferences
    – SQRCAT
    Jan 27, 2013 at 12:59
1

Within the Fonts & Colors tab, try adjusting the Whitespace field to 20~25px.

1
  • Why does this work better than the accepted answer from Saul?
    – Jeremy W
    May 30, 2012 at 3:29

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .