开发者

JFrame layout for fixed position

开发者 https://www.devze.com 2023-03-30 18:13 出处:网络
Which layout is suitable for p开发者_运维技巧ositioning components on a JFrame and making them stay where they have been placed? I don\'t want controls to move around on resizing.I suggest that you do

Which layout is suitable for p开发者_运维技巧ositioning components on a JFrame and making them stay where they have been placed? I don't want controls to move around on resizing.


I suggest that you don't use null layout and that you don't fix your components in absolute position, not unless you want to have very ugly GUI's that are difficult or impossible to use in various operating systems and screen resolutions. Much better is to not even set any sizes but rather to nest layout managers and let the managers set preferred and appropriate sizes by calling pack on your top-level window (the JFrame) after adding all components.


Use a null LayoutManager explained here

0

精彩评论

暂无评论...
验证码 换一张
取 消