第二十六次发博不知道用什么标题好

package Test;
import java.awt.*;
import javax.swing.*;

public class Example extends JFrame{
    public void CreatJFrame(String title) {
        JFrame jf = new JFrame(title);
        Container container = jf.getContentPane();
        JLabel jl = new JLabel("Hello");
        
        jl.setHorizontalAlignment(SwingConstants.CENTER);
        container.add(jl);
        container.setBackground(new Color(117,114,116));
        jf.setVisible(true);
        jf.setSize(100,200);
        jf.setDefaultCloseOperation(Example.EXIT_ON_CLOSE);
        
    }

    public static void main(String[] args) {
        // TODO Auto-generated method stub
        new Example().CreatJFrame("BiuBiuBiu");

    }

}

posted @ 2019-05-09 00:57  18软工8班段诗媛  阅读(76)  评论(0编辑  收藏  举报