首页 > 其他 > 详细

流式布局与组件按钮

时间:2021-05-16 22:12:50      阅读:20      评论:0      收藏:0      [点我收藏+]
package cn.rushangw.lesson01;

import java.awt.*;

public class TestFlowLayout {
public static void main(String[] args) {
Frame frame = new Frame();

//组件 按钮
Button button1 = new Button("按钮1");
Button button2 = new Button("按钮2");
Button button3 = new Button("按钮2");

//设置为流式布局
//frame.setLayout(new FlowLayout());
frame.setLayout(new FlowLayout(FlowLayout.LEFT));
//frame.setLayout(new FlowLayout(FlowLayout.RIGHT));

frame.setSize(200,200);

frame.add(button1);
frame.add(button2);
frame.add(button3);

frame.setVisible(true);
}

}

流式布局与组件按钮

原文:https://www.cnblogs.com/nigustudent/p/14774361.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!