• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Scaling Swing for a hi-res monitor.

 
Saloon Keeper
Posts: 10687
85
Eclipse IDE Firefox Browser MySQL Database VI Editor Java Windows ChatGPT
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm trying to convert a bunch of Swing programs to handle hi-res monitors. I wrote a scaling utility that works about 80% of the time but I'm desperate to handle the other 20% of the cases. After reading a bit about Java9's HiDPI support I was wondering if there's something in Java8 that I'm missing. I would like to modify my code base in such a way as to allow me to easily drop in HiDPI later without too much disturbance. Any nudge in the right direction would be appreciated.

Related post: https://coderanch.com/t/674214/java/HiDPI-res-monitors-detailed-documentation#3156379
 
Bartender
Posts: 11497
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Why is explicit scaling required for HDPI? Doesn't the use of proper layouts handle this correctly? Also I am under the impression (quite possibly wrong) that HDPI support is for images?
 
Carey Brown
Saloon Keeper
Posts: 10687
85
Eclipse IDE Firefox Browser MySQL Database VI Editor Java Windows ChatGPT
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The layout is correct on a hi-res monitor, it's just that you need a magnifying lens to see it. Fonts especially need to be scaled up, which doesn't happen automatically. Check boxes don't scale at all. Need two images for each icon. etc.
 
Maneesh Godbole
Bartender
Posts: 11497
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ah OK! I was thinking about it from the wrong perspective. Thanks for the clarification
 
Author
Posts: 986
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This will supposedly be fixed for Linux and Windows in Java9. It shouldn't require any code changes. For more information go to http://openjdk.java.net/projects/jdk9/ scroll down and click on "263: HiDPI Graphics on Windows and Linux". Early access builds are available at http://jdk9.java.net/ though I haven't tried them.

Supposedly it already works in MacOS.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic