JFrame not presenting any Components

后端 未结 4 1778
遇见更好的自我
遇见更好的自我 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:41

    Put frame.setVisible(true); after adding components to JFrame, and it will show all the added components. Moreover, you should use specific layout rather than setting bounds for components. You can use a Layout Manager.

提交回复
热议问题