You should just be able to call the add() method to add the second JPanel to the first one.