专门用于swing显示的工具类

package demo01;

import javax.swing.JFrame;
import javax.swing.SwingUtilities;

public class SwingConsole {

    public static void run(final JFrame f, final int width,final int height){
        SwingUtilities.invokeLater(new Runnable() {
           
            @Override
            public void run() {
                f.setTitle(f.getClass().getSimpleName());
                f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                f.setSize(width,height);
                f.setVisible(true);
            }
        });
    }
}

I'm falling off the sky all alone.The courage inside is gonna break the fall. Nothing can dim my light within. I am That I am 程序 = 数据结构 + 算法
原文地址:https://www.cnblogs.com/IamThat/p/2980875.html