关于Button使用的问题,求解
类Button1继承JFrame,在主方法里调用方法run(new Button1(),200,100);
run方法具体为:
public class SwingConsole {
public static void run(final JFrame f,final int width,final int height){
SwingUtilities.invokeLater(new Runnable(){
public void run(){
f.setTitle(f.getClass().getSimpleName());
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.setSize(width,height);
f.setVisible(true);
}
});
}
}
已确定Java类库引用没有问题,但是显示run方法调用失败:
Exception in thread "main" java.lang.Error: Unresolved compilation problem:
The method run(Button1, int, int) is undefined for the type Button1
at UI界面.Button1.main(Button1.java:23)
求解???