JFrame小示例

package com.xxx.xxx;

import javax.swing.*;

public class MyFrame extends JFrame {

    public MyFrame() {
        this.setTitle("MyFrame");
        this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        this.setVisible(true);
        this.setSize(400, 300);
        this.setResizable(false);
        this.setLocationRelativeTo(getOwner());
    }

    public static void main(String[] args) {
        new MyFrame();
    }

}
posted @ 2022-02-09 09:10  seaof  阅读(89)  评论(0编辑  收藏  举报