Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

share|improve this question
add comment

4 Answers

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

share|improve this answer
    
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
add comment
up vote 1 down vote accepted

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>
share|improve this answer
add comment

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

share|improve this answer
    
Why does this work better than the accepted answer from Saul? –  Jeremy W May 30 '12 at 3:29
add comment

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%.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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