-1

I'm trying to implement a new Jframe in net beans with

JFrame frame = new JFrame("shooter"); 

however when it is run nothing is happening. I have run the same code in another IDE and it works fine however I am not seeing a JFrame on the screen. I ran a test to see weather everything was compiling and that there was no syntactical or lexical error so nothing seems to be wrong per say. Thanks.

4

1 回答 1

0

根据您提供的信息很难提供答案,但我会尽力而为。通过实例化一个新的 JFrame 对象,您不会让它出现在屏幕上。

创建和显示新框架的示例如下所示

    JFrame frame = new JFrame("Title");
    frame.setSize(500, 500);  //This method will set the size of the frame to 500 by 500.
    frame.setVisible(true);  //This method makes the frame visible

我希望我能有所帮助。

于 2012-11-03T18:51:22.197 回答