eclipse不显示JFrame界面的处理操作教程
时间:2022-10-26 17:30
当前不少网友表示自己才接触eclipse这款应用,还不晓得不显示JFrame界面的处理操作教程,接下来就为你们分享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界面的处理操作方法吧,一定会帮到大家的。