Problema ao configurar frames

Gostaria de saber como faço nesse código fonte para em vez de guando eu clicar em pedidos abrir outra pagina eu apenas mudar a página, ao clicar nos botões ele abre outras páginas.

import java.awt.;
import javax.swing.
;

public class otica {
JFrame frame,frame2;
JPanel panel,panel2;

JButton bot1,bot2,bot3,bot4;
JLabel jl,jl1,jl2;

JTextField texto;

public static void main(String[] args){
	otica gui=new otica();
	gui.go();
}

void go(){
frame =new JFrame();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
bot1=new JButton(“Pedidos”);
bot2=new JButton(“Clientes”);
jl=new JLabel(“OTICA”);
panel=new JPanel();
jl1=new JLabel(“OTICA”);
panel.add(bot1);
panel.add(bot2);
frame.getContentPane().add(BorderLayout.WEST,panel);
frame.setSize(800, 600);
frame.setVisible(true);
bot1.addActionListener(new botaop());
bot2.addActionListener(new botaoc());
}

void pedidos(){
frame =new JFrame();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
bot2=new JButton(“Clientes”);
bot3=new JButton(“Adicionar pedido”);
jl=new JLabel(“OTICA”);
panel=new JPanel();
panel.add(bot2);
panel.add(bot3);
frame.getContentPane().add(BorderLayout.WEST,panel);
frame.setSize(800, 600);
frame.setVisible(true);
bot2.addActionListener(new botaoc());
}

void clientes(){

frame=new JFrame();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
bot1=new JButton("Pedidos");
bot4=new JButton("Adicionar cliente");
jl=new JLabel("OTICA");


panel=new JPanel();
panel.add(bot1);
panel.add(bot4);
frame.getContentPane().add(BorderLayout.WEST,panel);
frame.setSize(800, 600);
frame.setVisible(true);
bot4.addActionListener(new addcli());
bot1.addActionListener(new botaop());

}

void addclientes(){

frame=new JFrame();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
bot1=new JButton("Pedidos");
bot2=new JButton("Clientes");
jl=new JLabel("OTICA");
jl1=new JLabel("Nome do Cliente");
jl2=new JLabel("Rua");
texto=new JTextField(20);
panel=new JPanel();
panel2=new JPanel();
panel.add(bot1);
panel.add(bot2);
panel2.add(jl1);
panel2.add(texto);
panel2.add(jl2);
panel2.add(texto);
frame.getContentPane().add(BorderLayout.WEST,panel);
frame.getContentPane().add(BorderLayout.CENTER,panel2);
frame.setSize(800, 600);
frame.setVisible(true);
bot1.addActionListener(new botaop());
bot2.addActionListener(new botaoc());

}
public class botaop implements ActionListener{

@Override
public void actionPerformed(ActionEvent arg0) {
	otica o=new otica();
	o.pedidos();// TODO Auto-generated method stub
	}

}
public class botaoc implements ActionListener{

	@Override
	public void actionPerformed(ActionEvent arg0) {
		otica o=new otica();
		o.clientes();// TODO Auto-generated method stub
		}
	  }
 public class addped implements ActionListener{

	@Override
	public void actionPerformed(ActionEvent arg0) {
		// TODO Auto-generated method stub
		
	}
	 
	 
 }
 
 public class addcli implements ActionListener{

	@Override
	public void actionPerformed(ActionEvent arg0) {
		otica o=new otica();// TODO Auto-generated method stub
		o.clientes();
	}
 	 
 	 
 }

}

Bom, pelo que eu entendi você quer que o programa use apenas uma janela, do jeito que você está fazendo, o programa abre uma janela para cada função. É simples, em vez de criar outro JFrame você cria outro JPanel para cada função do programa e os ActionListener retiram o conteúdo da janela e colocam o JPanel com a função desejada. Mais ou menos assim:

public void actionPerformed(ActionEvent ev) {
container.removeAll();
container.add(panelAddCliente);
repaint();
}

Modifiquei o código apenas na parte de addClientes para testar porêm mesmo assim não consegui olhem o que fiz, ao clicar no botão não aparece nada, não consegui fazer com o container conforme o amigo de cima disse alguem poderia me explicar melhor é que faz apenas um mês que estou lendo livros de java tem coisas que não sei.

import java.awt.;
import javax.swing.
;

public class otica {
JFrame frame,frame2;
JPanel panelc,panelc2,panel;

JButton bot1,bot2,bot3,bot4;
JLabel jl,jl1,jl2;

JTextField texto;

public static void main(String[] args){
	otica gui=new otica();
	gui.go();
}

void go(){
frame =new JFrame();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
bot1=new JButton(“Pedidos”);
bot2=new JButton(“Clientes”);
jl=new JLabel(“OTICA”);
texto=new JTextField(20);
panel=new JPanel();
jl1=new JLabel(“OTICA”);
panel.add(bot1);
panel.add(bot2);
panel.add(jl1);
frame.getContentPane().add(BorderLayout.WEST,panel);
frame.setSize(800, 600);
frame.setVisible(true);
bot1.addActionListener(new botaop());
bot2.addActionListener(new botaoc());
}

void pedidos(){
frame =new JFrame();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
bot2=new JButton(“Clientes”);
bot3=new JButton(“Adicionar pedido”);
jl=new JLabel(“OTICA”);
panel=new JPanel();
panel.add(bot2);
panel.add(bot3);
frame.getContentPane().add(BorderLayout.WEST,panel);
frame.setSize(800, 600);
frame.setVisible(true);
bot2.addActionListener(new botaoc());
}

void clientes(){

frame=new JFrame();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
bot1=new JButton("Pedidos");
bot4=new JButton("Adicionar cliente");
jl=new JLabel("OTICA");


panel=new JPanel();
panel.add(bot1);
panel.add(bot4);
frame.getContentPane().add(BorderLayout.WEST,panel);
frame.setSize(800, 600);
frame.setVisible(true);
bot4.addActionListener(new addcli());
bot1.addActionListener(new botaop());

}

void addclientes(){

bot1=new JButton("Pedidos");
bot2=new JButton("Clientes");
jl=new JLabel("OTICA");
jl1=new JLabel("Nome do Cliente");
jl2=new JLabel("Rua");
texto=new JTextField(20);
panelc=new JPanel();
panelc2=new JPanel();
panelc.add(bot1);
panelc.add(bot2);
panelc2.add(jl1);
panelc2.add(texto);
panelc2.add(jl2);
panelc2.add(texto);
bot1.addActionListener(new botaop());
bot2.addActionListener(new botaoc());

}
public class botaop implements ActionListener{

@Override
public void actionPerformed(ActionEvent arg0) {
	otica o=new otica();
	o.pedidos();// TODO Auto-generated method stub
	}

}
public class botaoc implements ActionListener{

	@Override
	public void actionPerformed(ActionEvent arg0) {
		otica o=new otica();
		o.clientes();// TODO Auto-generated method stub
		}
	  }
 public class addped implements ActionListener{

	@Override
	public void actionPerformed(ActionEvent arg0) {
		// TODO Auto-generated method stub
		
	}
	 
	 
 }
 
 public class addcli implements ActionListener{

	
	public void actionPerformed(ActionEvent arg0) {
            frame.removeAll(); 
            frame.getContentPane().add(BorderLayout.WEST,panelc);
        	frame.getContentPane().add(BorderLayout.CENTER,panelc2);
        	frame.repaint(); 
			
	} 
		
	}
 	 
 	 
 }

Problema resolvido, olhem como fiz

import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.ContainerEvent;
import java.beans.Statement;
import java.sql.SQLException;

import javax.swing.*;

import com.sun.xml.internal.ws.api.server.ContainerResolver;

public class otica {
JFrame frame;
JPanel panelc,panelc2,panel;

JButton bot1,bot2,bot3,bot4;
JLabel jl,rua,tel,nome;

JTextField texto;

public static void main(String[] args){
	otica o=new otica();
	o.go();
}

void go(){
frame =new JFrame();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
bot1=new JButton(“Pedidos”);
bot2=new JButton(“Clientes”);
jl=new JLabel(“ÓTICA SÉRGIO MOÇO”);

panel=new JPanel();
panel.add(bot1);
panel.add(bot2);
rua=new JLabel("Rua");
nome=new JLabel("nome");
tel=new JLabel("tel");
texto=new JTextField(20);
panel.add(texto);
frame.getContentPane().add(BorderLayout.CENTER,jl);
frame.getContentPane().add(BorderLayout.WEST,panel);
frame.setSize(800, 600);
frame.setVisible(true);
bot1.addActionListener(new botaop());
bot2.addActionListener(new botaoc());

}

void pedidos(){
frame =new JFrame();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
bot2=new JButton(“Clientes”);
bot3=new JButton(“Adicionar pedido”);

panel=new JPanel();
panel.add(bot2);
panel.add(bot3);
frame.getContentPane().add(BorderLayout.WEST,panel);
frame.setSize(800, 600);
frame.setVisible(true);
bot2.addActionListener(new botaoc());
bot3.addActionListener(new addped());
}

void clientes(){

frame=new JFrame();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
bot1=new JButton("Pedidos");
bot4=new JButton("Adicionar cliente");
jl=new JLabel("OTICA");


panel=new JPanel();
panel.add(bot1);
panel.add(bot4);
frame.getContentPane().add(BorderLayout.WEST,panel);
frame.setSize(800, 600);
frame.setVisible(true);
bot4.addActionListener(new addcli());
bot1.addActionListener(new botaop());

}

void addclientes(){

frame =new JFrame();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
bot1=new JButton("Pedidos");
bot2=new JButton("Clientes");
jl=new JLabel("OTICA");
JTable table=new JTable(5,5);

texto=new JTextField(20);
panelc=new JPanel();
panelc2=new JPanel();
panelc.add(bot1);
panelc.add(bot2);
panelc.add(table);
panelc2.add(texto);
panelc2.add(texto);
frame.getContentPane().add(BorderLayout.WEST,panelc);
frame.setSize(800, 600);
frame.setVisible(true);
bot1.addActionListener(new botaop());
bot2.addActionListener(new botaoc());

}
public class botaop implements ActionListener{

@Override
public void actionPerformed(ActionEvent arg0) {
	otica o=new otica();
	frame.setVisible(false);
	o.pedidos();// TODO Auto-generated method stub
	}

}
public class botaoc implements ActionListener{

	@Override
	public void actionPerformed(ActionEvent arg0) {
		otica o=new otica();
		frame.setVisible(false);
		o.clientes();// TODO Auto-generated method stub
		}
	  }
 public class addped implements ActionListener{

	@Override
	public void actionPerformed(ActionEvent arg0) {
		frame.setVisible(false);
		otica o=new otica();
		o.pedidos();// TODO Auto-generated method stub
		}
	}
 
 public class addcli implements ActionListener{

	
	public void actionPerformed(ActionEvent arg0) {
         frame.setVisible(false);
         otica o=new otica();
         o.addclientes();
			} 
		}
 	 }