NetBeans IDE scaling on Windows 8/10

别等时光非礼了梦想. 提交于 2019-12-17 21:40:46

问题


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.


回答1:


  • Open C:\Program Files\NetBeans 8.0\etc\netbeans.conf
  • Change -J-Dsun.java2d.dpiaware=true to -J-Dsun.java2d.dpiaware=false



回答2:


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.




回答3:


  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




回答4:


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.




回答5:


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.




回答6:


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.




回答7:


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




回答8:


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



来源:https://stackoverflow.com/questions/23651486/netbeans-ide-scaling-on-windows-8-10

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!