JPanels need a display container to be visible, so you need to add it to the content pane of a Jframe and set the visibility of that JFrame to true to see it.



JFrame frame = new JFrame();...