title: Java Swing app looks tiny on high-DPI screen when it should be scaled to normal size
body: <p>How can I make my Java Swing app GUI scale properly to users on high-DPI screens?</p>
  
  <p>See the screenshot below. At the top you can see how tiny the app looks compared to Ubuntu's file explorer icons and gedit. In the bottom left you can see roughly what size the app should look like (and does look on regular DPI monitors). So I'm looking for a way to scale the GUI of the app properly when a high DPI monitor is in use. For example, gedit looks the same on both regular DPI and high DPI monitors. I want my app to behave like this.</p>
  
  <p><a href="https://i.stack.imgur.com/Junv2.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/Junv2.jpg" alt="enter image description here"></a></p>
  
  <p>Here is source code for the app: <a href="https://github.com/baobabKoodaa/baopass" rel="noreferrer">https://github.com/baobabKoodaa/baopass</a></p>
  
  <p>This is an extremely common problem affecting many apps. Roughly half of the apps I run on Ubuntu are scaled properly without any actions from the user, the other half are not scaled and look really tiny. Note that I'm mainly looking for a solution that doesn't require actions from the user (although any help is appreciated at this point - I haven't found any ways to scale it at all).</p>
  
  <p>According to <a href="https://bugs.openjdk.java.net/browse/JDK-8055212" rel="noreferrer">this</a> scaling should already work out of the box. It doesn't. I'm not sure if this is a bug or if there is some additional step I'm supposed to do besides running the app on Java 9?</p>