小编The*_*uce的帖子

对于HelloWorld类型,方法JFrame未定义

我不知道为什么但是我的hello world java项目出错:

对于HelloWorld类型,方法JFrame是未定义的.

我刚刚开始,有人可以向我解释错误和解决方案吗?

package helloworld;

import javax.swing.JFrame;

public class HelloWorld {
    public static HelloWorld HelloWorld;
    public final int WIDTH = 800, HEIGHT = 800;

    public HelloWorld() {
        JFrame jframe = JFrame();
        jframe.setSize(WIDTH, HEIGHT);
        jframe.setVisible(true);

    }

    public static void main(String[] args) {
        HelloWorld = new HelloWorld();
    }
}
Run Code Online (Sandbox Code Playgroud)

java methods swing undefined

0
推荐指数
1
解决办法
89
查看次数

标签 统计

java ×1

methods ×1

swing ×1

undefined ×1