当我运行程序时,label
textfield
等等button
是随机排列的(标签和按钮在同一行)。
如何明确设置布局?
当我运行程序时,label
textfield
等等button
是随机排列的(标签和按钮在同一行)。
如何明确设置布局?
您使用哪种技术?Java 摇摆?然后我可以向您推荐以下手册:
http://download.oracle.com/javase/tutorial/uiswing/layout/using.html#set
您应该使用所谓的“布局管理器”,它支持您安排不同的标签、字段等。
打招呼
尝试使用setBounds(x,y,length,heigth)
and setLayout(null)
。所以你可以设置它的坐标。