FlowLayoutDemo.java
资源名称:Java.rar [点击查看]
上传用户:szfcled
上传日期:2022-06-12
资源大小:236k
文件大小:1k
源码类别:
文件格式
开发平台:
Java
- import java.awt.*;
- import javax.swing.*;
- public class FlowLayoutDemo {
- private JFrame frame;
- private JButton button1,button2,button3;
- public static void main(String args[]) {
- FlowLayoutDemo that = new FlowLayoutDemo ();
- that.go();
- }
- public void go() {
- frame = new JFrame("Flow Layout");
- Container contentPane = frame.getContentPane();
- //为内容窗格设置FlowLayout布局管理器
- contentPane.setLayout(new FlowLayout());
- button1 = new JButton("图像增强");
- button2 = new JButton("图像恢复");
- button3 = new JButton("图像分割");
- contentPane.add(button1);
- contentPane.add(button2);
- contentPane.add(button3);
- frame.setSize(200,100);
- frame.setVisible(true);
- }
- }