简体   繁体   中英

Swing size issue for different screen resolution

I'm using Java Swing and I want to it to set its JFrame size and the size of inner components size based on Screen resolution. I also want it to be compatible on any device like Tablet, laptop. Any easy solution for this?

I also want it to be compatible on any device like Tablet,laptop.Any easy solution for this.

  • Put JScrollPane to JFrame , then put JPanel nested all JComponent s to JScrollPane , then all JComponent s are accesible for non-standard screens eg net_books, crazy tablets with two or more Native OS (most of screen in Native OS there is scrolled by default)

I'm using Java Swing and I want to it to set its JFrame size and the size of inner components size based on Screen resolution.

  • This is a job for LayoutManager

  • for really better look is not possible without manage with Font size, basically there are a few screen ratios (4:3, 16:9 ...) with a corresponding pixels (screen) resolutions, rest of then to leave for JScrollPane
  • there is not universal advice, everything depends of your GUI, how JComponents are laid, number of JComponents, its Rectangle on the screen
  • about the arts, make it look nice and good concept, (then nothing complicated)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM