0
//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
    }
}
4

1 回答 1

1

编码

public class NEX {extends JFrame

应该

public class NEX extends JFrame {

因为你在 Java 中工作。

此外,正如 Joop Eggen 所指出的,代码setSize(Width,Height);应该是setSize(WIDTH,HEIGHT);因为您在声明它们时使用了所有大写字母。

于 2013-09-21T20:21:03.427 回答