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


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


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">

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


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


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

<entry javaType="java.lang.Float" name="line-height-correction" xml:space="preserve">

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">

Then restart NetBeans.


  • For Netbeans 6.9.1 that's not entirely accurate. – Saul Nov 5 '10 at 13:40
  • Indeed. You answer seems better. – gulbrandr Nov 5 '10 at 14:28
  • gulbandr's answer worked as expected in Netbeans 7.1.1 in Mac OSX Lion. – Santhosh Jul 17 '12 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 – Cummander Checkov Jan 27 '13 at 12:59

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

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.