package nn;
import java.awt.*;
import javax.swing.*;//添加AWT和SWing库文件
public class fan extends JFrame//创建fan类继承JFrame
{
JButton btn1,btn2,btn3,btn4,btn5;
JPanel mainPan;
FlowLayout fLayout;
GridLayout gLayout;
BorderLayout bLayout;
CardLayout cLayout;//定义布局方式
public fan(String layoutstyle) //定义构造函数
{
super ("布局方式:"+layoutstyle);
mainPan=new JPanel();
fLayout=new FlowLayout(FlowLayout.LEFT);
gLayout=new GridLayout(3,2);
bLayout=new
按钮布局演示
最新推荐文章于 2022-09-13 20:10:03 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)