Java 为什么我用这个程序得到非法的开始类型?我刚开始,但唐';我看不出哪里出了错

Java 为什么我用这个程序得到非法的开始类型?我刚开始,但唐';我看不出哪里出了错,java,swing,user-interface,jframe,Java,Swing,User Interface,Jframe,代码 //NEX GUI import javax.swing.JFrame; public class NEX { extends JFrame private static final int WIDTH =500; private static final int HEIGHT =175; public NEX() { setTitle("New Customer"); //sets the title of the frame

代码

//NEX GUI
import javax.swing.JFrame;
public class NEX { extends JFrame

    private static final int WIDTH =500;
    private static final int HEIGHT =175;

    public NEX()
    {
      setTitle("New Customer"); //sets the title of the frame
      setSize(Width,Height);
    }        


    /**
      * @param args the command line arguments
      */
    public static void main(String[] args) {
      JFrame aNEX =new NEX();
      aNEX.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
      aNEX.setVisible(true); //display the frame
      // TODO code application logic here
    }
}
应该是

public class NEX {extends JFrame
因为你在Java工作

此外,正如Joop Eggen所指出的,代码
setSize(宽度、高度)
设置大小(宽度、高度)因为您在声明时使用了所有大写字母。

设置大小(宽度、高度)
public class NEX extends JFrame {