一些新手朋友可能还不清楚eclipse不显示JFrame界面的解决操作,而下面就带来了eclipse不显示JFrame界面的解决教程,一起来看看吧!

首先打开eclipse软件。再点击左上角的文件创建java项目。

在项目中建立包。再加入class类。

然后在class类的上面打入两行代码。分别是imports java.awt.*和imports javax.swing.*。

还要在类中输入主函数代码。为public static void main(String[] args){分括号里面}。

在将JFrame中的代码写到分括号里面。首先先创建JFrame对象,代码为JFrame a=new JFrame();。再设置窗口的大小,代码为a.setSize(200,200);。

然后就到窗口显示最重要的时刻。输入代码a.setVisible(ture);。其中ture就是使窗口可视化。就是现在运行代码的话,窗口就能看见了。


上面就是小编为大家带来的eclipse不显示JFrame界面的解决技巧,一起来学习学习吧。相信是可以帮助到一些新用户的。