顺序布局
作者:互联网
package gui.cn;
//顺序布局
import java.awt.*;
import javax.swing.*;
public class MorningData06 {
public static void main(String[] args) {
JFrame frm=new JFrame();
frm.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frm.setLayout(new FlowLayout());
JLabel laber[]=new JLabel[4];
for(int i=0;i<4;i++)
{
laber[i]=new JLabel();
laber[i].setText("组件"+i+1);
frm.add(laber[i]);
}
frm.setBounds(450,230,150,100);
frm.setVisible(true);
}
}
标签:顺序,布局,frm,laber,JFrame,import,new,JLabel 来源: https://blog.csdn.net/wanglongjiayou/article/details/116277250