It should be noted that there are several problems in the initial setup of the JFrame form:
1 & gt; By default, the form is invisible and needs to be made visible.
2> By default, the form has no size, so you need to set its size.
3> Forms cannot be closed by default. You need to set the closing method.
2. Add panels, layout methods and controls to JFrame.