80

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.

Black
  • 18,150
  • 39
  • 158
  • 271
mmvsbg
  • 3,570
  • 17
  • 52
  • 73
  • 1
    Does starting NetBeans with the system property `-Dsun.java2d.dpiaware=true` change anything? –  May 14 '14 at 10:07
  • Hello, how can I start NetBeans with this specific system property? Google is not particularly helpful on this matter. – mmvsbg May 14 '14 at 10:15
  • Check the FAQ: http://wiki.netbeans.org/NetBeansUserFAQ especially: http://wiki.netbeans.org/FaqStartupParameters –  May 14 '14 at 10:18
  • Thank you. I did try the system property that you suggested, but no change - NetBeans still starts in exactly the same way and everything is small and hardly visible. – mmvsbg May 14 '14 at 10:29

8 Answers8

172
  • Open C:\Program Files\NetBeans 8.0\etc\netbeans.conf
  • Change -J-Dsun.java2d.dpiaware=true to -J-Dsun.java2d.dpiaware=false
Lucas
  • 1,736
  • 1
  • 11
  • 3
  • 8
    Worked like a charm, thanks. The GUI and text are a bit blurry, but this sure beats changing my system's resolution! – DRAB Feb 11 '15 at 19:09
  • While this might fix the problem, you will loose the pixels in your program which can be the difference between SD and HD. I suggest you change the fontsize in the config file. – Jonathan May 17 '15 at 09:30
  • In 8.1 this solution worked best for me. Fonts are not blurry at all to my eyes, and the alternate solution of adjusting the font size left me with tiny unclickable icons, which is important because of how often I click on the small hint icons in the editor. – Ted Nov 07 '15 at 05:25
  • 1
    thanks :) your solution works like a charm on windows, but in ubuntu when i modified {netbeans-installation-dir}/etc/netbeans.conf it did nothing, any idea? – Mahdi Rashidi Dec 31 '15 at 08:39
  • @lucas This gave me an a blurred screen :( – vigamage May 01 '16 at 16:26
  • 3
    Thanks! I have 8.1 and now it works fine. But I think I am back to a non-5k, 1280x800 Display. All other who have problem here, please note that you must be running **NetBeans** from `netbeans64.exe` and not from `netbeans.exe`. – Peyman Mohamadpour May 18 '16 at 22:58
  • Only Stackoverflow can get this done with this ease. You have to restore editor font size if you put it bigger before – Lorenzo Lerate Jan 04 '17 at 16:51
  • I recently had this issue and while this fixed it, the text (like @DRAB said) is very blurry, makes Netbeans a bit unusable. Other editors don't have this issue (like visual studio code). – AntonioCS May 09 '17 at 22:02
  • Works for NetBeans 8.2 as well. Slick solution! – twigmac May 29 '18 at 20:10
  • This solution still works for windows 10. – Evan Gertis Feb 22 '21 at 02:02
50
  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

T. H
  • 509
  • 4
  • 3
44

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.

Alan
  • 506
  • 7
  • 24
Manik
  • 441
  • 4
  • 2
  • 5
    This temp fix is way better (no blurry font generated by turing dpiaware to false). Of course, only the text is changed. Looks like a clean fix is not planned for the next years... – Toto May 01 '15 at 23:36
  • 3
    Agreed. Setting this to 22, along with the default font for code editing to 22 and the darcula plugin looks pretty good on my Win10 / 4K monitor. – John K Jun 09 '16 at 20:51
  • For those using 109dpi monitor, like 27" 2560x1440, balanced value for fontsize is 16. I'm also using 125% of font scale. Win 7. – Alex Byrth Nov 05 '16 at 18:17
  • 2
    This is the best solution for me with Netbeans 8.2, Windows 10 and a 27" at 175%. – Toto Jun 09 '18 at 19:22
  • 24" - 1920x1200 --fontsize 12 - I feel young again :) Thank you. – Yevgeniy Afanasyev Jan 20 '19 at 23:02
  • I was happy with this approach until I ran a project that opens a Swing GUI. Well that did not scale well... – Asu Apr 14 '21 at 18:36
15

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.

Camelhive
  • 55
  • 1
  • 7
MichaSchumann
  • 1,361
  • 1
  • 17
  • 36
  • 1
    For anyone else thinking about trying this, my Windows 10 machine didn't have any problems with `dpiaware=false` and this looks exactly the same as that. – John K Jun 09 '16 at 20:50
11

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.

J. Burke
  • 179
  • 1
  • 5
5

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.

John K
  • 2,150
  • 2
  • 18
  • 19
-3

go to display settings and change scale and layout to 100% Boom! :)

Sergei
  • 5
  • 1
-4

Simply hold down the Alt key then scroll up or down to zoom out or in

lewiscool
  • 71
  • 1
  • 3
  • While this isn't an answer to the asked question regaerding IDE scaling it was incredibly helpful to me. I've been using Netbeans for years and was never aware of this keyboard shortcut for increasing the text size in the main editor window. – Night Owl Aug 31 '20 at 15:25