内部类只对它的包围类是可见的,因此不能在main()方法中实例化。
可以把他们定义为外部类,或者放到构造方法中:
public class NotHelloWorld
{
public NotHelloWorld()
{
NotHelloWorldFrame Nframe = new NotHelloWorldFrame();
Nframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
Nframe.show();
public static void main (String[] args)
{
new NotHelloWorld();
}······
可以把他们定义为外部类,或者放到构造方法中:
public class NotHelloWorld
{
public NotHelloWorld()
{
NotHelloWorldFrame Nframe = new NotHelloWorldFrame();
Nframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
Nframe.show();
public static void main (String[] args)
{
new NotHelloWorld();
}······
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货