My jframe doesn't shows [closed]

那年仲夏 提交于 2019-12-02 13:43:37

I think you didn't declare correctly your JFrame. Here is an example creating a simple frame :

public static void main(String[] args)
{
    // Creating a frame
    JFrame frame = new JFrame("Example");
    // Setting the position and the size of the frame
    frame.setBounds(0,0,800,600);
    // This will terminate the program when closing the frame
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    // Then you can display your frame
    frame.setVisible(true);
}
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!