JFrame not presenting any Components

后端 未结 4 1772
遇见更好的自我
遇见更好的自我 2020-12-04 03:00

I am using the following code to create a very simple JFrame, but for some reason it doesn\'t show any components, just a blank frame. Why is this happening? I

4条回答
  •  醉梦人生
    2020-12-04 03:38

    Better your first add components to your variable "panel" and add then your finished panel to the .getContentPane().add().

    And the most important issue is that you better call frame.setVisible(true); at the end of your method.

提交回复
热议问题