Is there a way I can create 4 JPanels inside an outer JPanel, however initially only the top JPanel is visible. Then when an event occurs the others appear 1 directly below the other with no gaps?
Just put the panels in the appropriate layout, for example a BoxLayout, and hide() the three lower panels initially. Call show() on them once you want them to be visible.