As for your problem, a JFrame (actually its content pane) uses a BorderLayout. This allows you to have only one component in the center. At the moment that is your JPanel. If you add a component without any constraints it will overwrite the current center component. You should either use some constraints (like BorderLayout.NORTH; check the BorderLayout API) or set a different LayoutManager using the setLayout method.