Set position of JTextField, JLabel and JButton in Java
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.
精彩评论