Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NetBeans IDE scaling on Windows 8/10

I'm trying to run NetBeans under Windows 8.1 on a screen with a high DPI. Windows itself has scaling enabled to 400% and everything else looks just fine.

However, when I start NetBeans, it runs as if there's no scaling enabled and I just see tiny little letters in the IDE. I did check the properties under which the IDE starts and they do have "Enable scaling for this program" checked.

I could increase font size in the editor and the error log, which would at least enable me to view what I'm typing on the screen, however, all menus, side-bars, panels, etc, remain very small which is very uncomfortable trying to work with. So any idea how I can make NetBeans scale with Windows 8.1? Currently using NetBeans 8.0.

like image 247
mmvsbg Avatar asked May 14 '14 10:05

mmvsbg


People also ask

How do I change font size in NetBeans GUI?

To change the GUI font-size only once, you can launch NetBeans with the --fontsize <size> option. To change the GUI font size permanently, edit netbeans. conf file. Specifically, in netbeans.

How do I format NetBeans?

To format all the code in NetBeans, press Alt + Shift + F. If you want to indent lines, select the lines and press Alt + Shift + right arrow key, and to unindent, press Alt + Shift + left arrow key.


6 Answers

  • Open C:\Program Files\NetBeans 8.0\etc\netbeans.conf
  • Change -J-Dsun.java2d.dpiaware=true to -J-Dsun.java2d.dpiaware=false
like image 81
Lucas Avatar answered Sep 29 '22 09:09

Lucas


  1. Right click on netbeans icon on desktop.
  2. Choose properties.
  3. Go to Compatibility tab.
  4. Tick Overide high DPI scaling and choose System in dropbox.
  5. Click apply.
  6. Open NetBeans.

Worked on Windows 10 on 4K resolution. Font and buttons are little blurred, but it doesn't bother me much because I am programming not watching movies anyway. Quick fix and easy to undo in case it gets messed up somewhere.

Image

like image 25
T. H Avatar answered Sep 30 '22 09:09

T. H


A workaround is to increase the font size of menu options. See: FaqFontSize - NetBeans Wiki

  • Open C:\Program Files\NetBeans 8.x\etc\netbeans.conf
  • Locate the line containing netbeans_default_options
  • Add --fontsize 18 within the quotes. Example: "<other -J options> --fontsize 18"

This will increase the font size within menus, which causes dynamic UI elements to increase in size, effectively a DPI scaling workaround. Only downside is icons/images do not scale.

like image 44
Manik Avatar answered Sep 30 '22 09:09

Manik


Unfortunately changing dpiaware setting in the .conf file did not work on my surface 4 pro and Windows 10. I found the solution in a link in the netbeans forum that seems to be an universal solution for all(!) programs that declare to be dpiaware and actually are not (see Dan Antonellis homepage).

The fix is quite simple: First set Windows to prefer external manifest files over internal ones (which was default until some Versions ago) by adding the key

DWORD PreferExternalManifest=1

to

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\SideBySide

Then create a manifest file (in this case netbeans64.exe.manifest or netbeans.exe.manifest) in the directory of the corresponding exe file with the following content:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3">

<dependency>
  <dependentAssembly>
    <assemblyIdentity
      type="win32"
      name="Microsoft.Windows.Common-Controls"
      version="6.0.0.0" processorArchitecture="*"
      publicKeyToken="6595b64144ccf1df"
      language="*">
    </assemblyIdentity>
  </dependentAssembly>
</dependency>

<dependency>
  <dependentAssembly>
    <assemblyIdentity
      type="win32"
      name="Microsoft.VC90.CRT"
      version="9.0.21022.8"
      processorArchitecture="amd64"
      publicKeyToken="1fc8b3b9a1e18e3b">
    </assemblyIdentity>
  </dependentAssembly>
</dependency>

<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
  <security>
    <requestedPrivileges>
      <requestedExecutionLevel
        level="asInvoker"
        uiAccess="false"/>
    </requestedPrivileges>
  </security>
</trustInfo>

<asmv3:application>
  <asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">
    <ms_windowsSettings:dpiAware xmlns:ms_windowsSettings="http://schemas.microsoft.com/SMI/2005/WindowsSettings">false</ms_windowsSettings:dpiAware>
  </asmv3:windowsSettings>
</asmv3:application>

</assembly>

This way I also could fix Visual Studio 2013 and SQL Server Management Console 2012 which are only partly dpi aware (e.g. Visual Studio 2013 the form editor is unusable on 200% as the complete layout is broken). I fixed all my apps that were unusable or at least had a bad layout this way.

Of course, depending on the display and desired size things might get a bit blurry, it is a question of personal preferences (sharpness vs. layout). At least this fix makes essential applications usable on higher dpi settings.

As this thread was the first one in my google results I thought it would be a good idea to post this solution although the last activity is quite long ago.

like image 42
MichaSchumann Avatar answered Sep 29 '22 09:09

MichaSchumann


Windows 10 does this for you now. Right click on your Netbeans shortcut (C:\ProgramData\Microsoft\Windows\Start Menu\Programs\NetBeans) and select Properties.

Go to the Compatibility tab and then select Change High DPI Settings. From there, check the Override High DPI Scaling box and set it to System.

like image 41
J. Burke Avatar answered Oct 01 '22 09:10

J. Burke


Similar to setting --fontsize 18, if you use the Darcula plugin, you can set the value for the "Override Default Fonts" option to 18. That has the same effect. Additionally, if you change it to Segoe UI, it matches Windows 10 nicely.

like image 32
John K Avatar answered Oct 02 '22 09:10

John K