Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jEveAssets looks bad on 4K monitors #11

Open
GoldenGnu opened this issue Aug 3, 2017 · 10 comments
Open

jEveAssets looks bad on 4K monitors #11

GoldenGnu opened this issue Aug 3, 2017 · 10 comments
Labels
bug Defect Workaround Workaround Avalible

Comments

@GoldenGnu
Copy link
Owner

GoldenGnu commented Aug 3, 2017

is there a way you can make it look better on a 4k screen
things get really smooshed and hard to read

Workaround Windows

  1. Find java.exe
  2. Right click -> Properties
  3. Go to Compatibility tab
  4. Check Override high DPI scaling behavior
  5. Choose System for Scaling performed by:

Notes: You may need to modify javaw.exe like this too

Workaround Linux

GDK_SCALE=2 GDK_DPI_SCALE=0.5 java -jar jeveassets.jar

@jowrjowr
Copy link

jowrjowr commented Aug 3, 2017

Example of how it looks under 4k:

http://i.imgur.com/pzPSHPL.png

@MordecaiMalignatus
Copy link

Workaround idea: Use Toolkit to detect 2k/4k screens and blow up display scaling (scale to 1080p, maybe 1440p, and implement some math to scale to oversized displays.)

@GoldenGnu
Copy link
Owner Author

GoldenGnu commented Aug 4, 2017

Looks like this may have been fixed in Java 9
http://openjdk.java.net/jeps/263 (Due to release in 47 days: http://www.java9countdown.xyz/)
Java 9 test builds download: http://jdk.java.net/9/

@jowrjowr
If you have time to give jEveAssets a test spin with Java 9, that would be appreciated. If not, that is fine too...

There is no easy way to scale swing.
You can scale the font size: https://stackoverflow.com/questions/26877517/java-swing-on-high-dpi-screen most components will scale with the font size.
And you can figure out the scale: https://stackoverflow.com/questions/36617892/swing-gui-layout-is-strange-in-4k-panel

@GoldenGnu GoldenGnu added the bug Defect label Aug 4, 2017
@jowrjowr
Copy link

jowrjowr commented Aug 4, 2017 via email

@GoldenGnu
Copy link
Owner Author

GoldenGnu commented Aug 8, 2017

@jowrjowr
Found another solution on stackoverflow:

  1. Find java.exe
  2. Right click -> Properties
  3. Go to Compatibility tab
  4. Check Override high DPI scaling behavior.
  5. Choose System for Scaling performed by:

Notes: You may need to modify javaw.exe like this too
If you have time to test this solution, that would be awesome

That said,
The scaling problem is fixed in Java 9, but, the jar file needs to be compiled with Java 9, running the current jeveassets.jar that is compiled with Java 8 will not work. It will take some time for me to migrate jEveAssets to Java 9, so, I really hope the solution above fix the problem, until I'm done moving to Java 9

@jowrjowr
Copy link

jowrjowr commented Aug 8, 2017

That works!

@GoldenGnu GoldenGnu added the Workaround Workaround Avalible label Aug 22, 2017
@GoldenGnu GoldenGnu changed the title Swing looks bad on 4K jEveAssets looks bad on 4K monitors Sep 2, 2017
@mkaito
Copy link

mkaito commented Feb 14, 2020

In case this comes up for anyone, it works for me on Linux under JRE 11 with GDK_SCALE=2 GDK_DPI_SCALE=0.5.

@GoldenGnu
Copy link
Owner Author

@mkaito
Could you explain that a little more. I don't use Linux often, so, I'm not 100% sure if those are command line arguments or something else. I want to add your workaround to the top post for visibility, but, I have to understand it.

@mkaito
Copy link

mkaito commented Feb 28, 2020

They're environment variables. You use them as such: GDK_SCALE=2 GDK_DPI_SCALE=0.5 <command to run>, so that they only apply to that command.

@GoldenGnu
Copy link
Owner Author

GoldenGnu commented Feb 28, 2020

@mkaito
I added the workaround to the top post:
GDK_SCALE=2 GDK_DPI_SCALE=0.5 java -jar jeveassets.jar
Thank you 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Defect Workaround Workaround Avalible
Projects
None yet
Development

No branches or pull requests

4 participants