2013-09-21 59 views
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 
    } 
} 
+0

'setSize(WIDTH,HEIGHT);' –

回答

1

代碼

public class NEX {extends JFrame 

應該

public class NEX extends JFrame { 

,因爲你在Java中工作。

此外,正如Joop Eggen指出的,代碼setSize(Width,Height);應該是setSize(WIDTH,HEIGHT);,因爲您在聲明它們時使用了全部大寫。

相關問題