1

so I spent days looking through the internet but couldn't solve my problem. I recently installed Fedora 31 on my Matebook X Pro (3000 x 2000 resolution), and my GUI was tiny. So I could scale my GUI in the settings to 200% and everything works perfectly, except for my own Java apps. They are really tiny, I can't even read the fonts. Any ideas on how to scale them (all together?) without having to change their code?

Appreciate all ideas

NiTE97
  • 11
  • 1

1 Answers1

0

It might work with setting the system to use large fonts.

Swing and JavaFX can code a scaling, and enlarge the application bounds by say a factor 1.75. Whether that repairs everything I do not know.

Scaling probably is needed when you worked in pixels. Otherwise setting a larger font would help. If buttons and such are small, and no pixel bounds are set, you could try a system LookAndFeel (UIManager).

Swing content pane:

@Override
public void paint(Graphics g) {
    Graphics2D g2 = (Graphics2D)g;
    final double scale = 2.0;
    g2.scale(scale, scale);
    super.paint(g);
    g2.scale(1/scale, 1/scale);
}
Joop Eggen
  • 107,315
  • 7
  • 83
  • 138