I need to implement a JFrame of a class into another one when i click a button.
Here is my code :
public class Test6 extends JFrame implements Runnable {
 private static final String DB_PATH = "C:/testtest";
 private static GraphDatabaseService graphDb;
 Graph graph;
 Viewer viewer;
 View view;
 public JPanel contentPane1;
public void run() {
     Transaction tx = graphDb.beginTx();
    try
    {
        contentPane1 = new JPanel();
    contentPane1.setBackground(Color.DARK_GRAY);
    contentPane1.setBorder(new EmptyBorder(5, 5, 5, 5));
    contentPane1.setLayout(new BorderLayout(0, 0));
    setContentPane(contentPane1);
    JPanel panelSettings = new JPanel();
    panelSettings.setBorder(new EmptyBorder(0, 8, 0, 8));
    panelSettings.setBackground(SystemColor.activeCaption);
    panelSettings.setLayout(new BorderLayout(0, 0));
    contentPane1.add(panelSettings, BorderLayout.WEST);
    viewer.enableAutoLayout();
    view = viewer.addDefaultView(false);
    contentPane1.add(view);
    setSize(800, 600);
    setVisible(true);
    setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
 }
and the other class code is :
public class GraphTest2 extends JFrame implements ActionListener 
{
public GraphTest2()
{
    Init();
}
public void Init()
{
    contentPane = new JPanel();
    contentPane.setBackground(Color.DARK_GRAY);
    contentPane.setBorder(new EmptyBorder(0,0,0,0));
    contentPane.setLayout(new BorderLayout(8,0));
    setContentPane(contentPane);
    JPanel panelSettings = new JPanel();   
    panelSettings.setLayout(new GridLayout(20,1,0,0));
        panelSettings.add(b1);
        public void actionPerformed(ActionEvent e) {
          if(e.getSource()==b1){
        }
Iam trying to use internal Frame but i didn't know how to implement it in my code. Thank you for your time and help.
 
    