简体   繁体   English

不同屏幕分辨率的摆动尺寸问题

[英]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. 我正在使用Java Swing,我想根据屏幕分辨率设置其JFrame大小和内部组件大小。 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) JScrollPane放到JFrame ,然后将JPanel嵌套所有JComponent s到JScrollPane ,然后所有JComponent都可以访问非标准屏幕,例如net_books,带有两个或更多Native OS的疯狂平板电脑(默认情况下,Native OS中的大部分屏幕都滚动)

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. 我正在使用Java Swing ,我想根据屏幕分辨率设置其JFrame大小和内部组件大小。

  • This is a job for LayoutManager 这是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 如果没有管理字体大小,真的更好看,基本上有一些屏幕比例(4:3,16:9 ...)与相应的像素(屏幕)分辨率,其余的时间留给JScrollPane
  • there is not universal advice, everything depends of your GUI, how JComponents are laid, number of JComponents, its Rectangle on the screen 没有通用的建议,一切都取决于你的GUI,JComponents是如何奠定的,JComponents的数量,它在屏幕上的矩形
  • about the arts, make it look nice and good concept, (then nothing complicated) 关于艺术,使它看起来很好,很好的概念,(然后没什么复杂的)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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