Why does the first panel added to a frame disappear?
The default layout of a JFrame (or more specifically in this case, the content pane of the frame) is a BorderLayout. When adding a component to a BordeLayout with no constraint, the Swing API will put the component in the CENTER. A BorderLayout can contain exactly one component in each of the 5 layout constraints. … Read more