//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


应该

public class NEX extends JFrame {


因为您正在使用Java。

另外,正如乔普·艾格(Joop Eggen)指出的那样,代码setSize(Width,Height);应该为setSize(WIDTH,HEIGHT);,因为在声明它们时使用了所有大写字母。

07-24 16:04