I have 3 JPanels and I want to place them all in one JPanel. I used the GridBagLayout for the main panel. But only one panel is getting added. Why might this be?
You should change gbc.gridx and/or gbc.gridy to be different for each panel