import javax.swing.*;
import java.awt.*;
class LayoutFrame extends JFrame{
public LayoutFrame(){
super("框架窗口");
this.setSize(300,200);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
public void SetLayout(){
FlowLayout Layout=new FlowLayout(FlowLayout.CENTER,8,8);
Container container=getContentPane();
container.setLayout(Layout);
JButton btnOk=new JButton("确定");
JButton btnOpen=new JButton("打开");
JButton btnClose=new JButton("关闭");
JButton btnHelp=new JButton("帮助");
container.add(btnOk);
container.add(btnOpen);
container.add(btnClose);
container.add(btnHelp);
}
public static void main(String[] args) {
// TODO Auto-generated method stub
LayoutFrame A=new LayoutFrame();
A.SetLayout();
A.show();
}
JAVA错误提示:错误: 找不到或无法加载主类 FlowLayout 怎么办啊~~~~
温馨提示:答案为网友推荐,仅供参考
你可能感兴趣的内容
大家正在搜