import javax.swing.*;
public class test {
JFrame f = new JFrame("测试");
Box top = new Box.createVerticalBox();
public static void main(String[] args)
{
}
}
为什么Box后面的创建方法调用不起来,老显示有错误呀??
public class test {
JFrame f = new JFrame("测试");
Box top = new Box.createVerticalBox();
public static void main(String[] args)
{
}
}
为什么Box后面的创建方法调用不起来,老显示有错误呀??
如果无参的构造函数应该这样用,如果是别的,请输入 入参
Box top = new Box().createVerticalBox();
import javax.swing.JFrame;
class test {
JFrame f = new JFrame("测试");
Box top =Box.createVerticalBox();
public static void main(String[] args)
{ }
}
这是什么写法啊
正常写法createVerticalBox这个方法是一个静态方法
Box top = Box.createVerticalBox();