CardLayout will help switch content within a frame. Basically we switch panels within a frame, rather than opening a new window. Hope this is what you meant
http://docs.oracle.com/javase/tutorial/uiswing/layout/card.html
//yes a root panel must be there. All your cards must be added to it
Jpanel rootPanel = new JPanel(new CardLayout());
//to add a panel
Jpanel card1= new Jpanel();
rootPanel.add(card1,"NameofFirstPanel");
//to switch to a card, say on a button press
CardLayout cards = (CardLayout) rootPanel.getLayout();
cards.show(rootPanel,"nameOfFirstPanel");