开发者

Set position of JTextField, JLabel and JButton in Java

开发者 https://www.devze.com 2023-02-05 20:23 出处:网络
When i run the program, the label textfield and button and so on are arranged randomly (label and button are in same li开发者_Python百科ne).

When i run the program, the label textfield and button and so on are arranged randomly (label and button are in same li开发者_Python百科ne).

How do I explicitly set the layout?


which technology do you use? Java Swing? Then I can recommend you the following manual:

http://download.oracle.com/javase/tutorial/uiswing/layout/using.html#set

You should work with so called "Layout Managers", which support you in arranging different labels, fields and so on.

greets


Try to use the setBounds(x,y,length,heigth) and setLayout(null). So you can set its coordinates.

0

精彩评论

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

关注公众号