I am creating a program, and I have my main class that works with all the JButtons, but I can't get my second class that calls the first class launch with the buttons. The JFrame will launch, but the buttons won't.
I am using eclipse just for the information.
Here is the code of my main class:
    public class Unescapable extends JPanel implements ActionListener
{
private static final long serialVersionUID = 1L;
private static final Font font1 = new Font("FONT", Font.BOLD, 75);
protected JButton b1;
protected JButton b2;
protected JButton b3;
protected JButton b5;
protected JTextField t1;
    public Unescapable() 
    {
        t1 = new JTextField("Unescapable");
        t1.setText("Unescapable");
        t1.setBounds(225, 50, 750, 100);
        t1.setForeground(Color.LIGHT_GRAY);
        t1.setOpaque(true);
        t1.setVisible(true);
        t1.setEditable(false);
        t1.setBackground(Color.BLACK);
        t1.setFont(font1);
        b1 = new JButton("Open Window");
        b1.setActionCommand("open");
        b1.setBackground(Color.GRAY);
        b1.setForeground(Color.white);
        b1.setOpaque(true);
        b1.setBorderPainted(false);
        b1.setBounds(280, 200, 390, 40);
        b1.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                b1.setBackground(Color.BLUE);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                b1.setBackground(Color.GRAY);
            }
        });
        b2 = new JButton("Delete File");
        b2.setActionCommand("delete");
        b2.setBackground(Color.GRAY);
        b2.setForeground(Color.white);
        b2.setOpaque(true);
        b2.setBorderPainted(false);
        b2.setBounds(280, 255, 390, 40);
        b2.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                b2.setBackground(Color.BLUE);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                b2.setBackground(Color.GRAY);
            }
        });
        b3 = new JButton("Info...");
        b3.setActionCommand("info");
        b3.setBackground(Color.GRAY);
        b3.setForeground(Color.white);
        b3.setOpaque(true);
        b3.setBorderPainted(false);
        b3.setBounds(278, 330, 185, 40);
        b3.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                b3.setBackground(Color.BLUE);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                b3.setBackground(Color.GRAY);
            }
        });
        b5 = new JButton("Quit Game");
        b5.setActionCommand("close");
        b5.setBackground(Color.GRAY);
        b5.setForeground(Color.white);
        b5.setOpaque(true);
        b5.setBorderPainted(false);
        b5.setBounds(485, 330, 185, 40);
        b5.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                b5.setBackground(Color.BLUE);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                b5.setBackground(Color.GRAY);
            }
        });
        b1.addActionListener(this);
        b2.addActionListener(this);
        b3.addActionListener(this);
        b5.addActionListener(this);
        b1.setToolTipText("Opens Another JWindow");
        b2.setToolTipText("Deletes \"text.txt\"");
        b3.setToolTipText("Give's some information.");
        add(b1);
        add(b2);
        add(b3);
        add(b5);
        add(t1);
        System.out.println("Main Window Is Running");
    }
    public void actionPerformed(ActionEvent e) 
    {
        if ("open".equals(e.getActionCommand()))
        {
            File f = new File("text.txt");
            try
            {
                PrintWriter out = new PrintWriter(f);
                out.println("TheBestMacTutorials");
                out.close();
            }
            catch (Exception e2)
            {
            }
        } 
        else if ("delete".equals(e.getActionCommand()))
        {
            File f = new File("text.txt");
            f.delete();
        }
        else if ("info".equals(e.getActionCommand()))
        {
            InfoBook add = new InfoBook();
            add.call();
        }
        else
        {
            System.out.println("Window Is Now Closing");
            System.exit(0);
        }
    }
    private static void createAndShowGUI() 
    {
        JFrame program = new JFrame("My Program");
        program.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        Unescapable newContentPane = new Unescapable();
        program.setContentPane(newContentPane);
        program.setLayout(null);
        program.setVisible(true);
        program.setLocation(850, 445);
        program.setSize(900, 580);
        program.setTitle("Unescapable 1.0");
        program.setBackground(Color.GREEN);
        program.isOpaque();
        program.isForegroundSet();
        program.getContentPane().setBackground(Color.BLACK);
    }
    public static void main(String[] args) 
    {   
        javax.swing.SwingUtilities.invokeLater(new Runnable() 
        {
                public void run() 
                {
                    createAndShowGUI(); 
            }
      });
 }
    }
The code for the "Info Book":
    public class InfoBook extends JFrame
{
private static final long serialVersionUID = 1L;
private static final Font font1 = new Font("FONT", Font.BOLD, 75);
protected JButton b1;
protected JButton b2;
protected JTextField t1;
public InfoBook()
{
    b1 = new JButton("Cancel");
    b1.setActionCommand("cancel");
    b1.setBackground(Color.GRAY);
    b1.setForeground(Color.white);
    b1.setOpaque(true);
    b1.setBorderPainted(false);
    b1.setBounds(280, 200, 390, 40);
    b1.addMouseListener(new java.awt.event.MouseAdapter() {
        public void mouseEntered(java.awt.event.MouseEvent evt) {
            b1.setBackground(Color.BLUE);
        }
        public void mouseExited(java.awt.event.MouseEvent evt) {
            b1.setBackground(Color.GRAY);
        }
    });
    b2 = new JButton("More Info");
    b2.setBackground(Color.GRAY);
    b2.setForeground(Color.WHITE);
    b2.addMouseListener(new java.awt.event.MouseAdapter() {
        public void mouseEntered(java.awt.event.MouseEvent evt) {
            b2.setBackground(Color.BLUE);
        }
        public void mouseExited(java.awt.event.MouseEvent evt) {
            b2.setBackground(Color.GRAY);
        }
    });
    t1 = new JTextField("Info");
    t1.setText("Info...");
    t1.setBounds(225, 50, 750, 100);
    t1.setForeground(Color.LIGHT_GRAY);
    t1.setOpaque(true);
    t1.setVisible(true);
    t1.setEditable(false);
    t1.setBackground(Color.BLACK);
    t1.setFont(font1);
    b1.setToolTipText("Opens Another JWindow");
    b2.setToolTipText("Gives More Infomation");
    add(b1);
    add(b2);
    add(t1);
    System.out.println("Info is now running");
}
public static void creatAndShowGUI()
{
    JFrame frame = new JFrame("Info Panel");
    frame.setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);
    InfoBook newContentPane = new InfoBook();
    frame.setLayout(null);
    frame.setVisible(true);
    frame.setLocation(850, 445);
    frame.setSize(900, 580);
    frame.setTitle("Unescapable 1.0");
    frame.setBackground(Color.GREEN);
    frame.isOpaque();
    frame.isForegroundSet();
    frame.getContentPane().setBackground(Color.BLACK);
}
public static void call()
{
    javax.swing.SwingUtilities.invokeLater(new Runnable()
    {
        public void run()
        {
            creatAndShowGUI();
        }
    });
}
}
I believe thats all the code, and I am not very used to how to format the code in stack overflow, so I might of messed something up. I am probably just getting something messed up, so i am sorry for that but thanks in advance.
 
     
    