adoptium / adoptium/adoptium-support

Swing app problems with GUI scaling in Windows

Open
#401 4 comments 0 reactions 0 assignees View on GitHub
bug jbs:needs-report windows
Dominant language
No language data
Stars
59
Forks
13
PR merge metrics
No merged PRs in 30d

Description

## Steps to reproduce

I'm using Windows Preferences -> System -> Display -> Scale

When I set it to 150% and then start my sample app, the fonts are very small:

![image](https://user-images.githubusercontent.com/687761/142210352-7094e1d7-422a-4918-99d2-053632b09d22.png)

Interestingly, when I start the app with scale set to 100% and then change the scale to 150%, it looks good:

![image](https://user-images.githubusercontent.com/687761/142210482-ee1d2af6-7c45-42c4-a709-a02d9a459381.png)

Attaching the sample app code: [MyTest.java.txt](https://github.com/adoptium/adoptium-support/files/7554971/MyTest.java.txt)

## Triaging info

Java version:

openjdk version "11.0.13" 2021-10-19
OpenJDK Runtime Environment Temurin-11.0.13+8 (build 11.0.13+8)
OpenJDK 64-Bit Server VM Temurin-11.0.13+8 (build 11.0.13+8, mixed mode)

What is your operating system and platform?

Windows 11 Pre 21H2 on x86-64
Also occurs in Windows 10

How did you install Java?

installer package - MSI

Contributor guide

Open the contributing guide

Research direction

Start with the attached MyTest.java sample and reproduce the behavior on Windows 10 or Windows 11 using Temurin 11.0.13, first launching at 150% scaling and then changing from 100% to 150%. Investigate the difference in startup behavior; done means Swing fonts render appropriately when the application starts while Windows display scaling is already set to 150%.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
desktop, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.