sooo i finally got the new "pop up" frame after a button is clicked. so than after the user clicks the button and new frame pops up i try to add some stuff and buttons to that new frame.. but it doesn't show. it's just a black frame. I don't understand. Can someone help/modify so it displays. thanks!@

this is my program (I bolded the part where I added the new buttons to the new popup page, but it still shows black on the popup page.. how come? >.>"

import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.awt.Dimension;

public class RestaurantFirstPage1 {
  final static String LABEL_TEXT = "Welcome to the restaurant rating website";
  JFrame frame;
  JFrame firstFrame;
  JFrame secondFrame;
  JPanel contentPane;
  JLabel label;
  JButton signIn;
  JButton signUp;
  JButton exit;
  JButton exit2; 
  
  public RestaurantFirstPage1() {
    frame = new JFrame("Restaurant First Page");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    
    contentPane = new JPanel();
    contentPane.setLayout(new BoxLayout(contentPane, BoxLayout.PAGE_AXIS));
    contentPane.setBorder(BorderFactory.createEmptyBorder(50,20,30,20));
    contentPane.setBackground(Color.white); 
    
    label = new JLabel(LABEL_TEXT);
    label.setForeground(Color.black); 
    label.setAlignmentX(JLabel.CENTER_ALIGNMENT);
    label.setBorder(BorderFactory.createEmptyBorder(20,50,20,50));
    contentPane.add(label);
    
    signIn = new JButton("Sign In");   
    contentPane.add(signIn);
    signIn.setAlignmentX(JButton.CENTER_ALIGNMENT);
    contentPane.add(Box.createRigidArea(new Dimension(0, 15)));
    signIn.setActionCommand("Sign In");
    signIn.addActionListener(new NextPage()); 
                          
    signUp = new JButton("Sign Up");
    contentPane.add(signUp);
    signUp.setAlignmentX(JButton.CENTER_ALIGNMENT);
    contentPane.add(Box.createRigidArea(new Dimension(0, 15)));
    signUp.setActionCommand("Sign Up");
    signUp.addActionListener(new NextPage());
    
    exit = new JButton("Exit");
    contentPane.add(exit);
    exit.setAlignmentX(JButton.CENTER_ALIGNMENT);
    contentPane.add(Box.createRigidArea(new Dimension(0, 15)));
    exit.addActionListener(new Terminate());
  
    frame.setContentPane(contentPane);
    
    frame.pack();
    frame.setVisible(true);
  }

    private static void runGUI() {
      JFrame.setDefaultLookAndFeelDecorated(true);
      
      RestaurantFirstPage1 firstPage = new RestaurantFirstPage1();
    }
    
    class NextPage implements ActionListener { 

    public void actionPerformed(ActionEvent event) {
      String eventName = event.getActionCommand();
      
      if(eventName.equals("Sign In")) {
[b]        firstFrame(); 
        frame.dispose(); 
        frame = null; 
        
      }
      else if(eventName.equals("Sign Up")) {
        secondFrame(); 
        frame.dispose(); 
        frame = null; 

      } 
    } 
    
    private void firstFrame() { 
      firstFrame = new JFrame("SignIn"); 
      firstFrame.setSize(350, 320); 
      firstFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); 
      firstFrame.setVisible(true);     
      

    } 
    private void secondFrame() { 
      secondFrame = new JFrame("SignUp"); 
      secondFrame.setSize(350, 320); 
      secondFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); 
      secondFrame.setVisible(true); [/b] 
      
    }    
    }
    
    class Terminate implements ActionListener {   
      public void actionPerformed(ActionEvent event) {
      System.exit(0);
    }
    }
    

    public static void main(String[] args) {
      javax.swing.SwingUtilities.invokeLater(new Runnable() {
        public void run() {
          runGUI();
        }
      });
    }
  }

In your firstFrame() and SecondFrame() you havent added any buttons.You added buttons only in frame.When you dispose your frame, your it buttons are lost and there are no buttons any firstFrame and SecondFrame() so they wont showup.
You need to add all the buttons to your new frame firstframe() and secondframe() also.
A alternative slotion as I already told before will be to use different panels. You can have one buttonpanel which is always visible and others panels are swapped and made visible accordingly. In this case you wont need to add buttons everytime

In your firstFrame() and SecondFrame() you havent added any buttons.You added buttons only in frame.When you dispose your frame, your it buttons are lost and there are no buttons any firstFrame and SecondFrame() so they wont showup.
You need to add all the buttons to your new frame firstframe() and secondframe() also.
A alternative slotion as I already told before will be to use different panels. You can have one buttonpanel which is always visible and others panels are swapped and made visible accordingly. In this case you wont need to add buttons everytime

ooops my bad. I get what you mean. It's because I added the wrong program.. let me re-add the updated program. in the updated program I did add the buttons to the firstFrame but it's not showing thats the problem. sorry, can you look at the program I just uploaded up there again.

how do I re-edit thread? o_o
anyways this is the code I meant to ask for help:

import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.awt.Dimension;

public class RestaurantFirstPage1 {
  final static String LABEL_TEXT = "Welcome to the restaurant rating website";
  JFrame frame;
  JFrame firstFrame;
  JFrame secondFrame;
  JPanel contentPane;
  JLabel label;
  JButton showButton;
  JButton signIn;
  JButton signUp;
  JButton exit;
  JButton exit2; 
  
  public RestaurantFirstPage1() {
    frame = new JFrame("Restaurant First Page");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    
    contentPane = new JPanel();
    contentPane.setLayout(new BoxLayout(contentPane, BoxLayout.PAGE_AXIS));
    contentPane.setBorder(BorderFactory.createEmptyBorder(50,20,30,20));
    contentPane.setBackground(Color.white); 
    
    label = new JLabel(LABEL_TEXT);
    label.setForeground(Color.black); 
    label.setAlignmentX(JLabel.CENTER_ALIGNMENT);
    label.setBorder(BorderFactory.createEmptyBorder(20,50,20,50));
    contentPane.add(label);
    
    signIn = new JButton("Sign In");   
    contentPane.add(signIn);
    signIn.setAlignmentX(JButton.CENTER_ALIGNMENT);
    contentPane.add(Box.createRigidArea(new Dimension(0, 15)));
    signIn.setActionCommand("Sign In");
    signIn.addActionListener(new NextPage()); 
                          
    signUp = new JButton("Sign Up");
    contentPane.add(signUp);
    signUp.setAlignmentX(JButton.CENTER_ALIGNMENT);
    contentPane.add(Box.createRigidArea(new Dimension(0, 15)));
    signUp.setActionCommand("Sign Up");
    signUp.addActionListener(new NextPage());
    
    exit = new JButton("Exit");
    contentPane.add(exit);
    exit.setAlignmentX(JButton.CENTER_ALIGNMENT);
    contentPane.add(Box.createRigidArea(new Dimension(0, 15)));
    exit.addActionListener(new Terminate());
  
    frame.setContentPane(contentPane);
    
    frame.pack();
    frame.setVisible(true);
  }

    private static void runGUI() {
      JFrame.setDefaultLookAndFeelDecorated(true);
      
      RestaurantFirstPage1 firstPage = new RestaurantFirstPage1();
    }
    
    class NextPage implements ActionListener { 

    public void actionPerformed(ActionEvent event) {
      String eventName = event.getActionCommand();
      
      if(eventName.equals("Sign In")) {
//        firstFrame(); 
        frame.dispose(); 
        frame = null; 
   
        
      }
      else if(eventName.equals("Sign Up")) {
        secondFrame(); 
        frame.dispose(); 
        frame = null; 

      } 
    } 
    
    private void firstFrame() { 
      firstFrame = new JFrame("SignIn"); 
      firstFrame.setSize(350, 320); 
      firstFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); 
      firstFrame.setVisible(true);

      showButton = new JButton("button testing"); 
      showButton.setActionCommand("button testing");
      showButton.addActionListener(this); 
      contentPane.add(showButton); 


    } 
    private void secondFrame() { 
      secondFrame = new JFrame("SignUp"); 
      secondFrame.setSize(350, 320); 
      secondFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); 
      secondFrame.setVisible(true); 
      
    }    
    }
    
    class Terminate implements ActionListener {   
      public void actionPerformed(ActionEvent event) {
      System.exit(0);
    }
    }
    

    public static void main(String[] args) {
      javax.swing.SwingUtilities.invokeLater(new Runnable() {
        public void run() {
          runGUI();
        }
      });
    }
  }

how do I re-edit thread? o_o
anyways this is the code I meant to ask for help:

import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.awt.Dimension;

public class RestaurantFirstPage1 {
  final static String LABEL_TEXT = "Welcome to the restaurant rating website";
  JFrame frame;
  JFrame firstFrame;
  JFrame secondFrame;
  JPanel contentPane;
  JLabel label;
  JButton showButton;
  JButton signIn;
  JButton signUp;
  JButton exit;
  JButton exit2; 
  
  public RestaurantFirstPage1() {
    frame = new JFrame("Restaurant First Page");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    
    contentPane = new JPanel();
    contentPane.setLayout(new BoxLayout(contentPane, BoxLayout.PAGE_AXIS));
    contentPane.setBorder(BorderFactory.createEmptyBorder(50,20,30,20));
    contentPane.setBackground(Color.white); 
    
    label = new JLabel(LABEL_TEXT);
    label.setForeground(Color.black); 
    label.setAlignmentX(JLabel.CENTER_ALIGNMENT);
    label.setBorder(BorderFactory.createEmptyBorder(20,50,20,50));
    contentPane.add(label);
    
    signIn = new JButton("Sign In");   
    contentPane.add(signIn);
    signIn.setAlignmentX(JButton.CENTER_ALIGNMENT);
    contentPane.add(Box.createRigidArea(new Dimension(0, 15)));
    signIn.setActionCommand("Sign In");
    signIn.addActionListener(new NextPage()); 
                          
    signUp = new JButton("Sign Up");
    contentPane.add(signUp);
    signUp.setAlignmentX(JButton.CENTER_ALIGNMENT);
    contentPane.add(Box.createRigidArea(new Dimension(0, 15)));
    signUp.setActionCommand("Sign Up");
    signUp.addActionListener(new NextPage());
    
    exit = new JButton("Exit");
    contentPane.add(exit);
    exit.setAlignmentX(JButton.CENTER_ALIGNMENT);
    contentPane.add(Box.createRigidArea(new Dimension(0, 15)));
    exit.addActionListener(new Terminate());
  
    frame.setContentPane(contentPane);
    
    frame.pack();
    frame.setVisible(true);
  }

    private static void runGUI() {
      JFrame.setDefaultLookAndFeelDecorated(true);
      
      RestaurantFirstPage1 firstPage = new RestaurantFirstPage1();
    }
    
    class NextPage implements ActionListener { 

    public void actionPerformed(ActionEvent event) {
      String eventName = event.getActionCommand();
      
      if(eventName.equals("Sign In")) {
//        firstFrame(); 
        frame.dispose(); 
        frame = null; 
   
        
      }
      else if(eventName.equals("Sign Up")) {
        secondFrame(); 
        frame.dispose(); 
        frame = null; 

      } 
    } 
    
    private void firstFrame() { 
      firstFrame = new JFrame("SignIn"); 
      firstFrame.setSize(350, 320); 
      firstFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); 
      firstFrame.setVisible(true);

      showButton = new JButton("button testing"); 
      showButton.setActionCommand("button testing");
      showButton.addActionListener(this); 
      contentPane.add(showButton); 


    } 
    private void secondFrame() { 
      secondFrame = new JFrame("SignUp"); 
      secondFrame.setSize(350, 320); 
      secondFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); 
      secondFrame.setVisible(true); 
      
    }    
    }
    
    class Terminate implements ActionListener {   
      public void actionPerformed(ActionEvent event) {
      System.exit(0);
    }
    }
    

    public static void main(String[] args) {
      javax.swing.SwingUtilities.invokeLater(new Runnable() {
        public void run() {
          runGUI();
        }
      });
    }
  }

Still you are not adding the panel to your frame. You need to add contantPanel to your Firstframe().

To redit your post you have to click edit button below your post

ahh I don't get it.
sorry D:

can you give me that code?

contentPane = new JPanel(); contentPane.setLayout(new BoxLayout(contentPane, BoxLayout.PAGE_AXIS)); contentPane.setBorder(BorderFactory.createEmptyBorder(50,20,30,20));

something like that? :\

ahh I don't get it.
sorry D:

can you give me that code?

contentPane = new JPanel(); contentPane.setLayout(new BoxLayout(contentPane, BoxLayout.PAGE_AXIS)); contentPane.setBorder(BorderFactory.createEmptyBorder(50,20,30,20));

something like that? :

import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.awt.Dimension;

public class RestaurantFirstPage1 {
  final static String LABEL_TEXT = "Welcome to the restaurant rating website";
  JFrame frame;
  JFrame firstFrame;
  JFrame secondFrame;
  JPanel contentPane;
  JLabel label;
  JButton showButton;
  JButton signIn;
  JButton signUp;
  JButton exit;
  JButton exit2;

  public RestaurantFirstPage1() {
    frame = new JFrame("Restaurant First Page");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

    contentPane = new JPanel();
    contentPane.setLayout(new BoxLayout(contentPane, BoxLayout.PAGE_AXIS));
    contentPane.setBorder(BorderFactory.createEmptyBorder(50,20,30,20));
    contentPane.setBackground(Color.white);

    label = new JLabel(LABEL_TEXT);
    label.setForeground(Color.black);
    label.setAlignmentX(JLabel.CENTER_ALIGNMENT);
    label.setBorder(BorderFactory.createEmptyBorder(20,50,20,50));
    contentPane.add(label);

    signIn = new JButton("Sign In");
    contentPane.add(signIn);
    signIn.setAlignmentX(JButton.CENTER_ALIGNMENT);
    contentPane.add(Box.createRigidArea(new Dimension(0, 15)));
    signIn.setActionCommand("Sign In");
    signIn.addActionListener(new NextPage());

    signUp = new JButton("Sign Up");
    contentPane.add(signUp);
    signUp.setAlignmentX(JButton.CENTER_ALIGNMENT);
    contentPane.add(Box.createRigidArea(new Dimension(0, 15)));
    signUp.setActionCommand("Sign Up");
    signUp.addActionListener(new NextPage());

    exit = new JButton("Exit");
    contentPane.add(exit);
    exit.setAlignmentX(JButton.CENTER_ALIGNMENT);
    contentPane.add(Box.createRigidArea(new Dimension(0, 15)));
    exit.addActionListener(new Terminate());

    frame.setContentPane(contentPane);

    frame.pack();
    frame.setVisible(true);
  }

    private static void runGUI() {
      JFrame.setDefaultLookAndFeelDecorated(true);

      RestaurantFirstPage1 firstPage = new RestaurantFirstPage1();
    }

    class NextPage implements ActionListener {

    public void actionPerformed(ActionEvent event) {
      String eventName = event.getActionCommand();

      if(eventName.equals("Sign In")) {
        firstFrame();
        frame.dispose();
        frame = null;


      }
      else if(eventName.equals("Sign Up")) {
        secondFrame();
        frame.dispose();
        frame = null;

      }
    }

    private void firstFrame() {
      firstFrame = new JFrame("SignIn");
      firstFrame.setSize(350, 320);
      firstFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
      firstFrame.setVisible(true);

      showButton = new JButton("button testing");
      showButton.setActionCommand("button testing");
      showButton.addActionListener(this);
      JPanel contentPane1 = new JPanel();
      contentPane1.add(showButton);
      firstFrame.add(contentPane1);

    }
    private void secondFrame() {
      secondFrame = new JFrame("SignUp");
      secondFrame.setSize(350, 320);
      secondFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
      secondFrame.setVisible(true);

    }
    }

    class Terminate implements ActionListener {
      public void actionPerformed(ActionEvent event) {
      System.exit(0);
    }
    }


    public static void main(String[] args) {
      javax.swing.SwingUtilities.invokeLater(new Runnable() {
        public void run() {
          runGUI();
        }
      });
    }
  }

Edited 6 Years Ago by gunjannigam: Forgot code tags

Comments
helpful thanks
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.awt.Dimension;

public class RestaurantFirstPage1 {
  final static String LABEL_TEXT = "Welcome to the restaurant rating website";
  JFrame frame;
  JFrame firstFrame;
  JFrame secondFrame;
  JPanel contentPane;
  JLabel label;
  JButton showButton;
  JButton signIn;
  JButton signUp;
  JButton exit;
  JButton exit2;

  public RestaurantFirstPage1() {
    frame = new JFrame("Restaurant First Page");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

    contentPane = new JPanel();
    contentPane.setLayout(new BoxLayout(contentPane, BoxLayout.PAGE_AXIS));
    contentPane.setBorder(BorderFactory.createEmptyBorder(50,20,30,20));
    contentPane.setBackground(Color.white);

    label = new JLabel(LABEL_TEXT);
    label.setForeground(Color.black);
    label.setAlignmentX(JLabel.CENTER_ALIGNMENT);
    label.setBorder(BorderFactory.createEmptyBorder(20,50,20,50));
    contentPane.add(label);

    signIn = new JButton("Sign In");
    contentPane.add(signIn);
    signIn.setAlignmentX(JButton.CENTER_ALIGNMENT);
    contentPane.add(Box.createRigidArea(new Dimension(0, 15)));
    signIn.setActionCommand("Sign In");
    signIn.addActionListener(new NextPage());

    signUp = new JButton("Sign Up");
    contentPane.add(signUp);
    signUp.setAlignmentX(JButton.CENTER_ALIGNMENT);
    contentPane.add(Box.createRigidArea(new Dimension(0, 15)));
    signUp.setActionCommand("Sign Up");
    signUp.addActionListener(new NextPage());

    exit = new JButton("Exit");
    contentPane.add(exit);
    exit.setAlignmentX(JButton.CENTER_ALIGNMENT);
    contentPane.add(Box.createRigidArea(new Dimension(0, 15)));
    exit.addActionListener(new Terminate());

    frame.setContentPane(contentPane);

    frame.pack();
    frame.setVisible(true);
  }

    private static void runGUI() {
      JFrame.setDefaultLookAndFeelDecorated(true);

      RestaurantFirstPage1 firstPage = new RestaurantFirstPage1();
    }

    class NextPage implements ActionListener {

    public void actionPerformed(ActionEvent event) {
      String eventName = event.getActionCommand();

      if(eventName.equals("Sign In")) {
        firstFrame();
        frame.dispose();
        frame = null;


      }
      else if(eventName.equals("Sign Up")) {
        secondFrame();
        frame.dispose();
        frame = null;

      }
    }

    private void firstFrame() {
      firstFrame = new JFrame("SignIn");
      firstFrame.setSize(350, 320);
      firstFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
      firstFrame.setVisible(true);

      showButton = new JButton("button testing");
      showButton.setActionCommand("button testing");
      showButton.addActionListener(this);
      JPanel contentPane1 = new JPanel();
      contentPane1.add(showButton);
      firstFrame.add(contentPane1);

    }
    private void secondFrame() {
      secondFrame = new JFrame("SignUp");
      secondFrame.setSize(350, 320);
      secondFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
      secondFrame.setVisible(true);

    }
    }

    class Terminate implements ActionListener {
      public void actionPerformed(ActionEvent event) {
      System.exit(0);
    }
    }


    public static void main(String[] args) {
      javax.swing.SwingUtilities.invokeLater(new Runnable() {
        public void run() {
          runGUI();
        }
      });
    }
  }

omg, thank you!
finally know how to do it now.
i'll give u points for this. thanks!

thanks. you are welcome :)

Is there a way I can change the position of that button?
Like the button right now is on the very top, but I want it more to the center. and I'm trying to add another button under that button:

like the first button is the [Tacobell] button, I wanted to add [Mcdonald] button right under tacobell button but it's not displaying..
Example: http://i47.tinypic.com/29g1kjn.jpg

/* Creates a homepage frame */ 
     private void homepageFrame() { 
      homepageFrame = new JFrame("Homepage"); 
      homepageFrame.setSize(350, 320); 
      homepageFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); 
      homepageFrame.setVisible(true);
      
      /* creates a button called tacobell */ 
      tacobellButton = new JButton("Taco Bell");
      tacobellButton.setActionCommand("TacoBell");
      tacobellButton.addActionListener(this); 
      contentPane.add(Box.createRigidArea(new Dimension(0, 15)));
      JPanel contentPanel = new JPanel(); 
      contentPanel.add(tacobellButton);
      homepageFrame.add(contentPanel);
      
      /* creates a button called mcdonald under the tacobell button */ 
     /* but it's not displaying - and not it's not even making the tacobell button display */ 
      mcdonaldButton = new JButton("Mcdonald");
      mcdonaldButton.setActionCommand("Mcdonald");
      mcdonaldButton.addActionListener(this); 
      contentPane.add(Box.createRigidArea(new Dimension(0, 15)));
      JPanel contentPanel2 = new JPanel(); 
      contentPanel.add(mcdonaldButton);
      homepageFrame.add(contentPanel2);

First of all you need to all the buttons in one panel. And then you will get to see all of them
To make it vible at the center you need to use LayoutMangers. Try going through this tutorial. Hope it will help you a lot in future also

First of all you need to all the buttons in one panel. And then you will get to see all of them
To make it vible at the center you need to use LayoutMangers. Try going through this tutorial. Hope it will help you a lot in future also

What do you mean in one panel? Don't I have it all in one panel? :S

so i guess this layout/code doesn't work with the layouts or do i just have to add some codes to it.

tacobellButton = new JButton("Taco Bell");
      tacobellButton.setActionCommand("TacoBell");
      tacobellButton.addActionListener(this); 
      contentPane.add(Box.createRigidArea(new Dimension(0, 15)));
      JPanel contentPanel = new JPanel(); 
      contentPanel.add(tacobellButton);
      homepageFrame.add(contentPanel);

What do you mean in one panel? Don't I have it all in one panel? :S

so i guess this layout/code doesn't work with the layouts or do i just have to add some codes to it.

tacobellButton = new JButton("Taco Bell");
      tacobellButton.setActionCommand("TacoBell");
      tacobellButton.addActionListener(this); 
      contentPane.add(Box.createRigidArea(new Dimension(0, 15)));
      JPanel contentPanel = new JPanel(); 
      contentPanel.add(tacobellButton);
      homepageFrame.add(contentPanel);

I your code where you added two buttons you added the second button McDonald to different panel. Add both to same panel. This will show all the buttons. To show where they should be visible, you need to use LayoutManger

I your code where you added two buttons you added the second button McDonald to different panel. Add both to same panel. This will show all the buttons. To show where they should be visible, you need to use LayoutManger

oh no wonder.. but if i don't use the layout manager would it still display the buttons?

oh wait, yeaa ive tried that keep it the same panel but it gives me this error:

1 error found:
[line: 105]
Error: C:\Documents and Settings\HP_Administrator\My Documents\RestaurantFirstPage.java:105: contentPane1 is already defined in firstFrame()

Edited 6 Years Ago by StarZ: n/a

oh wait, yeaa ive tried that keep it the same panel but it gives me this error:

1 error found:
[line: 105]
Error: C:\Documents and Settings\HP_Administrator\My Documents\RestaurantFirstPage.java:105: contentPane1 is already defined in firstFrame()

paste your code.

oh no wonder.. but if i don't use the layout manager would it still display the buttons?

Yaa it will display all the buttons. FlowLayout is already defined as default so if you dont use it still be setting components as per FlowLayout

paste your code.

alright. My program is like really long but most of the stuff are duplicated so I hope you don't get to confused... scroll them to the button (it's where my new buttons/frames are created.

import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.awt.Dimension;

public class RestaurantFirstPage1 {
  final static String LABEL_TEXT = "Welcome to the restaurant rating website";
  /* Frames */
  JFrame frame;
  JFrame homepageFrame;
  JFrame signinFrame;
  JFrame signupFrame;
  JFrame tacobellFrame; 
  JFrame mcdonaldFrame; 
  JFrame arbysFrame;
  JFrame subwayFrame; 
  JFrame burgerkingFrame; 
  JFrame wendysFrame;
  JFrame harveysFrame; 
  JFrame dairyqueenFrame; 
  JFrame newyorkfriesFrame; 
  JFrame pizzapizzaFrame; 
  JFrame kfcFrame;
  /* Panel */ 
  JPanel contentPane;
  JPanel contentPanel; 
  JPanel contentPanel2; 
  /* label */ 
  JLabel label;
  /* first page buttons */ 
  JButton enter; 
  JButton signIn;
  JButton signUp;
  JButton exit;
  /* homepage buttons */ 
  JButton homepage; 
  JButton tacobellButton;
  JButton mcdonaldButton;
  JButton arbysButton; 
  JButton subwayButton; 
  JButton burgerkingButton; 
  JButton wendysButton; 
  JButton harveysButton; 
  JButton dairyqueenButton; 
  JButton newyorkfriesButton;
  JButton pizzapizzaButton; 
  JButton kfcButton;
 
  /*
   * the main page
   */ 
  
  public RestaurantFirstPage1() {
    frame = new JFrame("Restaurant First Page");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
     
    /* Creates the first frame */ 
    contentPane = new JPanel();
    contentPane.setLayout(new BoxLayout(contentPane, BoxLayout.PAGE_AXIS));
    contentPane.setBorder(BorderFactory.createEmptyBorder(50,20,30,20));
    contentPane.setBackground(Color.white);

    label = new JLabel(LABEL_TEXT);
    label.setAlignmentX(JLabel.CENTER_ALIGNMENT);
    label.setBorder(BorderFactory.createEmptyBorder(20,50,20,50));
    contentPane.add(label);
    
    /* enter button */ 
    enter = new JButton("Enter");
    enter.setActionCommand("Enter");
    enter.addActionListener(new NextPage());
    enter.setAlignmentX(JButton.CENTER_ALIGNMENT);
    contentPane.add(Box.createRigidArea(new Dimension(0, 15)));
    contentPane.add(enter); 
    
    
    /* sign in button */ 
    signIn = new JButton("Sign In");
    signIn.setAlignmentX(JButton.CENTER_ALIGNMENT);
    signIn.setActionCommand("Sign In");
    signIn.addActionListener(new NextPage());
    contentPane.add(Box.createRigidArea(new Dimension(0, 15)));
    contentPane.add(signIn);
    
    /* sign up button */ 
    signUp = new JButton("Sign Up");
    signUp.setActionCommand("Sign Up");
    signUp.addActionListener(new NextPage());
    signUp.setAlignmentX(JButton.CENTER_ALIGNMENT);
    contentPane.add(Box.createRigidArea(new Dimension(0, 15)));
    contentPane.add(signUp);

    /* exit button */ 
    exit = new JButton("Exit");
    exit.setAlignmentX(JButton.CENTER_ALIGNMENT);
    exit.addActionListener(new Terminate());
    contentPane.add(Box.createRigidArea(new Dimension(0, 15)));
    contentPane.add(exit);


    frame.setContentPane(contentPane);
    frame.pack();
    frame.setVisible(true);
  }

    private static void runGUI() {
      JFrame.setDefaultLookAndFeelDecorated(true);

      RestaurantFirstPage1 firstPage = new RestaurantFirstPage1();
    }

    class NextPage implements ActionListener {

   /** 
    * Frames being displayed.
    */ 
      
      public void actionPerformed(ActionEvent event) {
      String eventName = event.getActionCommand();

      /* Displays homepage frame */ 
      if(eventName.equals("Enter")) {
        homepageFrame();
        frame.dispose();
        frame = null;
      } 
      
      /* Displays sign in frame */ 
      else if(eventName.equals("Sign In")) { 
        signinFrame(); 
        frame.dispose(); 
        frame = null;      
        
      }
      
      /*Displays sign up frame */
      else if(eventName.equals("Sign Up")) {
        signupFrame();
        frame.dispose();
        frame = null;
      }
      
      /* displays taco bell frame */ 
      else if(eventName.equals("Taco Bell")) { 
        tacobellFrame(); 
        homepage.dispose();
        homepageFrame = null; 
      } 
      
      /* displays mcdonald frame */       
      else if(eventName.equals("Mcdonald")) { 
        mcdonaldFrame(); 
        homepage.dispose(); 
        homepageFrame = null; 
      } 
      
      /* displays arby's frame */
      else if(eventName.equals("Arby's")) { 
        arbysFrame(); 
        homepage.dispose(); 
        homepageFrame = null;
      } 
      
      /* displays subway frame */ 
      else if(eventName.equals("Subway")) { 
        subwayFrame(); 
        homepage.dispose(); 
        homepageFrame = null; 
      } 
      
      /* displays burger king frame */ 
      else if(eventName.equals("Burger King")) { 
        burgerkingFrame(); 
        homepage.dispose(); 
        homepageFrame = null; 
      } 
      
      /* displays wendy's frame */ 
      else if(eventName.equals("Wendy's")) { 
        wendysFrame(); 
        homepage.dispose(); 
        frame = null; 
      } 
      
      /* displays harvey's frame */ 
      else if(eventName.equals("Harvey's")) { 
        harveysFrame(); 
        homepage.dispose(); 
        homepageFrame = null; 
      } 
      
      /* displays dairy queen frame */ 
      else if(eventName.equals("Dairy Queen")) { 
        dairyqueenFrame(); 
        homepage.dispose(); 
        homepageFrame = null; 
      } 
      
      /* displays new york fries frame */ 
      else if(eventName.equals("New York Fries")) { 
        newyorkfriesFrame(); 
        homepage.dispose(); 
        homepageFrame = null; 
      } 
      
      /* displays pizza pizza frame */ 
      else if(eventName.equals("Pizza Pizza")) { 
        pizzapizzaFrame(); 
        homepage.dispose(); 
        homepageFrame = null; 
      } 
      
      /* displays kfc frame */ 
      else if(eventName.equals("KFC")) { 
        kfcFrame(); 
        homepage.dispose(); 
        homepageFrame = null;         
    }
      
    /* 
     * Frames being created.
     * Inside the frames, individual buttons are created 
     */ 
   
   
    /* creates a sign in frame */ 
    private void signinFrame() {
      signinFrame = new JFrame("SignIn");
      signinFrame.setSize(350, 320);
      signinFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
      signinFrame.setVisible(true);
    } 
    
    /* creates a sign up frame */  
    private void signupFrame() {
      signupFrame = new JFrame("SignUp");
      signupFrame.setSize(350, 320);
      signupFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
      signupFrame.setVisible(true);
    }
    
        /* Creates a homepage frame */ 
    private void homepageFrame() { 
      homepageFrame = new JFrame("Homepage"); 
      homepageFrame.setSize(350, 320); 
      homepageFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); 
      homepageFrame.setVisible(true);
      
      /* creates a button called tacobell */ 
      tacobellButton = new JButton("Taco Bell");
      tacobellButton.setActionCommand("TacoBell");
      tacobellButton.addActionListener(this); 
      contentPane.add(Box.createRigidArea(new Dimension(0, 15)));
      JPanel contentPanel = new JPanel(); 
      contentPanel.add(tacobellButton);
      homepageFrame.add(contentPanel);   
      
      /* creates a button called mcdonald */ 
      mcdonaldButton = new JButton("Mcdonald");
      mcdonaldButton.setActionCommand("Mcdonald");
      mcdonaldButton.addActionListener(this); 
      contentPane.add(Box.createRigidArea(new Dimension(0, 15)));
      JPanel contentPanel = new JPanel(); 
      contentPanel.add(mcdonaldButton);
      homepageFrame.add(contentPanel);
      
      /* creates a button called Arby's */ 
      arbysButton = new JButton("Arby's");
      arbysButton.setActionCommand("Arby's");
      arbysButton.addActionListener(this); 
      contentPane.add(Box.createRigidArea(new Dimension(0, 15)));
      JPanel contentPanel = new JPanel(); 
      contentPanel.add(arbysButton);
      homepageFrame.add(contentPanel);
      
      /* creates a button called subway */ 
      subwayButton = new JButton("Subway");
      subwayButton.setActionCommand("Subway");
      subwayButton.addActionListener(this); 
      contentPane.add(Box.createRigidArea(new Dimension(0, 15)));
      JPanel contentPanel = new JPanel(); 
      contentPanel.add(subwayButton);
      homepageFrame.add(contentPanel);
      
      /* creates a button called wendy's */ 
      wendysButton = new JButton("Wendy's");
      wendysButton.setActionCommand("Wendy's");
      wendysButton.addActionListener(this); 
      contentPane.add(Box.createRigidArea(new Dimension(0, 15)));
      JPanel contentPanel = new JPanel(); 
      contentPanel.add(wendysButton);
      homepageFrame.add(contentPanel);
      
      /* creates a button called Harvey's */
      harveysButton = new JButton("Harvey's");
      harveysButton.setActionCommand("Harvey's");
      harveysButton.addActionListener(this); 
      contentPane.add(Box.createRigidArea(new Dimension(0, 15)));
      JPanel contentPanel = new JPanel(); 
      contentPanel.add(harveysButton);
      homepageFrame.add(contentPanel);
      
      /* creates a button called dairy queen */ 
      dairyqueenButton = new JButton("Dairy Queen");
      dairyqueenButton.setActionCommand("Dairy Queen");
      dairyqueenButton.addActionListener(this); 
      contentPane.add(Box.createRigidArea(new Dimension(0, 15)));
      JPanel contentPanel = new JPanel(); 
      contentPanel.add(dairyqueenButton);
      homepageFrame.add(contentPanel);
      
      /* Creates a button called new york fries */ 
      newyorkfriesButton = new JButton("New York Fries");
      newyorkfriesButton.setActionCommand("New York Fries");
      newyorkfriesButton.addActionListener(this); 
      contentPane.add(Box.createRigidArea(new Dimension(0, 15)));
      JPanel contentPanel = new JPanel(); 
      contentPanel.add(newyorkfriesButton);
      homepageFrame.add(contentPanel);
      
      /* Creates a button called pizza pizza */ 
      pizzapizzaButton = new JButton("Pizza Pizza");
      pizzapizzaButton.setActionCommand("Pizza Pizza");
      pizzapizzaButton.addActionListener(this); 
      contentPane.add(Box.createRigidArea(new Dimension(0, 15)));
      JPanel contentPanel = new JPanel(); 
      contentPanel.add(pizzapizzaButton);
      homepageFrame.add(contentPanel);
      
      /* creates a button called KFC */ 
      kfcButton = new JButton("KFC");
      kfcButton.setActionCommand("KFC");
      kfcButton.addActionListener(this); 
      contentPane.add(Box.createRigidArea(new Dimension(0, 15)));
      JPanel contentPanel = new JPanel(); 
      contentPanel.add(kfcButton);
      homepageFrame.add(contentPanel);
    } 

    /* creates a tacobell frame */ 
    private void tacobellFrame() {
      tacobellFrame = new JFrame("Taco Bell");
      tacobellFrame.setSize(350, 320);
      tacobellFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
      tacobellFrame.setVisible(true);
      
    } 
    
    /* creates a mcdonald frame */ 
    private void mcdonaldFrame() {
      mcdonaldFrame = new JFrame("Mcdonald");
      mcdonaldFrame.setSize(350, 320);
      mcdonaldFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
      mcdonaldFrame.setVisible(true);

    } 
    
   /* creates a arby's frame */ 
    private void arbysFrame() {
      arbysFrame = new JFrame("Arby's");
      arbysFrame.setSize(350, 320);
      arbysFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
      arbysFrame.setVisible(true);
    } 
    
    /* creates a subway frame */ 
    private void subwayFrame() {
      subwayFrame = new JFrame("Subway");
      subwayFrame.setSize(350, 320);
      subwayFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
      subwayFrame.setVisible(true);
    } 
    
    /* creates a burger king frame */
    private void burgerkingFrame() {
      burgerkingFrame = new JFrame("Burger King");
      burgerkingFrame.setSize(350, 320);
      burgerkingFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
      burgerkingFrame.setVisible(true);
    } 
    
    /* creates a wendy's frame */ 
    private void wendysFrame() {
      wendysFrame = new JFrame("Wendy's");
      wendysFrame.setSize(350, 320);
      wendysFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
      wendysFrame.setVisible(true);
    } 
    
    /* creates a harvey's frame */ 
    private void harveysFrame() {
      harveysFrame = new JFrame("Harvey's");
      harveysFrame.setSize(350, 320);
      harveysFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
      harveysFrame.setVisible(true);
    } 
    
    /* creates a dairy queen frame */ 
    private void dairyqueenFrame() {
      dairyqueenFrame = new JFrame("Dairy Queen");
      dairyqueenFrame.setSize(350, 320);
      dairyqueenFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
      dairyqueenFrame.setVisible(true);
    } 
    
    /* creates a new york fries frame */ 
    private void newyorkfriesFrame() {
      newyorkfriesFrame = new JFrame("New York Fries");
      newyorkfriesFrame.setSize(350, 320);
      newyorkfriesFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
      newyorkfriesFrame.setVisible(true);
    } 
    
    /* creates a pizza pizza frame */ 
    private void pizzapizzaFrame() {
      pizzapizzaFrame = new JFrame("Pizza Pizza");
      pizzapizzaFrame.setSize(350, 320);
      pizzapizzaFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
      pizzapizzaFrame.setVisible(true);
    } 

    /* creates a kfc frame */
    private void kfcFrame() {
      kfcFrame = new JFrame("KFC");
      kfcFrame.setSize(350, 320);
      kfcFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
      kfcFrame.setVisible(true);
      
      
    } 
            
    
    }

    class Terminate implements ActionListener {
      public void actionPerformed(ActionEvent event) {
      System.exit(0);
    }
    }

    public static void main(String[] args) {
      javax.swing.SwingUtilities.invokeLater(new Runnable() {
        public void run() {
          runGUI();
        }
      });
    }
  }

Yaa it will display all the buttons. FlowLayout is already defined as default so if you dont use it still be setting components as per FlowLayout

Yea the problem is I'm not using the flowLayout... I was about too but than I didn't know how I should rechange my codes to flowlayout... like at the beginning I want the "Columned" buttons (which I have) and than afterwords the flowlayout... but I got tooo confused on how to place it in there, so i didn't do it.

alright. My program is like really long but most of the stuff are duplicated so I hope you don't get to confused... scroll them to the button (it's where my new buttons/frames are created.

import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.awt.Dimension;

public class RestaurantFirstPage1 {
  final static String LABEL_TEXT = "Welcome to the restaurant rating website";
  /* Frames */
  JFrame frame;
  JFrame homepageFrame;
  JFrame signinFrame;
  JFrame signupFrame;
  JFrame tacobellFrame; 
  JFrame mcdonaldFrame; 
  JFrame arbysFrame;
  JFrame subwayFrame; 
  JFrame burgerkingFrame; 
  JFrame wendysFrame;
  JFrame harveysFrame; 
  JFrame dairyqueenFrame; 
  JFrame newyorkfriesFrame; 
  JFrame pizzapizzaFrame; 
  JFrame kfcFrame;
  /* Panel */ 
  JPanel contentPane;
  JPanel contentPanel; 
  JPanel contentPanel2; 
  /* label */ 
  JLabel label;
  /* first page buttons */ 
  JButton enter; 
  JButton signIn;
  JButton signUp;
  JButton exit;
  /* homepage buttons */ 
  JButton homepage; 
  JButton tacobellButton;
  JButton mcdonaldButton;
  JButton arbysButton; 
  JButton subwayButton; 
  JButton burgerkingButton; 
  JButton wendysButton; 
  JButton harveysButton; 
  JButton dairyqueenButton; 
  JButton newyorkfriesButton;
  JButton pizzapizzaButton; 
  JButton kfcButton;
 
  /*
   * the main page
   */ 
  
  public RestaurantFirstPage1() {
    frame = new JFrame("Restaurant First Page");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
     
    /* Creates the first frame */ 
    contentPane = new JPanel();
    contentPane.setLayout(new BoxLayout(contentPane, BoxLayout.PAGE_AXIS));
    contentPane.setBorder(BorderFactory.createEmptyBorder(50,20,30,20));
    contentPane.setBackground(Color.white);

    label = new JLabel(LABEL_TEXT);
    label.setAlignmentX(JLabel.CENTER_ALIGNMENT);
    label.setBorder(BorderFactory.createEmptyBorder(20,50,20,50));
    contentPane.add(label);
    
    /* enter button */ 
    enter = new JButton("Enter");
    enter.setActionCommand("Enter");
    enter.addActionListener(new NextPage());
    enter.setAlignmentX(JButton.CENTER_ALIGNMENT);
    contentPane.add(Box.createRigidArea(new Dimension(0, 15)));
    contentPane.add(enter); 
    
    
    /* sign in button */ 
    signIn = new JButton("Sign In");
    signIn.setAlignmentX(JButton.CENTER_ALIGNMENT);
    signIn.setActionCommand("Sign In");
    signIn.addActionListener(new NextPage());
    contentPane.add(Box.createRigidArea(new Dimension(0, 15)));
    contentPane.add(signIn);
    
    /* sign up button */ 
    signUp = new JButton("Sign Up");
    signUp.setActionCommand("Sign Up");
    signUp.addActionListener(new NextPage());
    signUp.setAlignmentX(JButton.CENTER_ALIGNMENT);
    contentPane.add(Box.createRigidArea(new Dimension(0, 15)));
    contentPane.add(signUp);

    /* exit button */ 
    exit = new JButton("Exit");
    exit.setAlignmentX(JButton.CENTER_ALIGNMENT);
    exit.addActionListener(new Terminate());
    contentPane.add(Box.createRigidArea(new Dimension(0, 15)));
    contentPane.add(exit);


    frame.setContentPane(contentPane);
    frame.pack();
    frame.setVisible(true);
  }

    private static void runGUI() {
      JFrame.setDefaultLookAndFeelDecorated(true);

      RestaurantFirstPage1 firstPage = new RestaurantFirstPage1();
    }

    class NextPage implements ActionListener {

   /** 
    * Frames being displayed.
    */ 
      
      public void actionPerformed(ActionEvent event) {
      String eventName = event.getActionCommand();

      /* Displays homepage frame */ 
      if(eventName.equals("Enter")) {
        homepageFrame();
        frame.dispose();
        frame = null;
      } 
      
      /* Displays sign in frame */ 
      else if(eventName.equals("Sign In")) { 
        signinFrame(); 
        frame.dispose(); 
        frame = null;      
        
      }
      
      /*Displays sign up frame */
      else if(eventName.equals("Sign Up")) {
        signupFrame();
        frame.dispose();
        frame = null;
      }
      
      /* displays taco bell frame */ 
      else if(eventName.equals("Taco Bell")) { 
        tacobellFrame(); 
        homepage.dispose();
        homepageFrame = null; 
      } 
      
      /* displays mcdonald frame */       
      else if(eventName.equals("Mcdonald")) { 
        mcdonaldFrame(); 
        homepage.dispose(); 
        homepageFrame = null; 
      } 
      
      /* displays arby's frame */
      else if(eventName.equals("Arby's")) { 
        arbysFrame(); 
        homepage.dispose(); 
        homepageFrame = null;
      } 
      
      /* displays subway frame */ 
      else if(eventName.equals("Subway")) { 
        subwayFrame(); 
        homepage.dispose(); 
        homepageFrame = null; 
      } 
      
      /* displays burger king frame */ 
      else if(eventName.equals("Burger King")) { 
        burgerkingFrame(); 
        homepage.dispose(); 
        homepageFrame = null; 
      } 
      
      /* displays wendy's frame */ 
      else if(eventName.equals("Wendy's")) { 
        wendysFrame(); 
        homepage.dispose(); 
        frame = null; 
      } 
      
      /* displays harvey's frame */ 
      else if(eventName.equals("Harvey's")) { 
        harveysFrame(); 
        homepage.dispose(); 
        homepageFrame = null; 
      } 
      
      /* displays dairy queen frame */ 
      else if(eventName.equals("Dairy Queen")) { 
        dairyqueenFrame(); 
        homepage.dispose(); 
        homepageFrame = null; 
      } 
      
      /* displays new york fries frame */ 
      else if(eventName.equals("New York Fries")) { 
        newyorkfriesFrame(); 
        homepage.dispose(); 
        homepageFrame = null; 
      } 
      
      /* displays pizza pizza frame */ 
      else if(eventName.equals("Pizza Pizza")) { 
        pizzapizzaFrame(); 
        homepage.dispose(); 
        homepageFrame = null; 
      } 
      
      /* displays kfc frame */ 
      else if(eventName.equals("KFC")) { 
        kfcFrame(); 
        homepage.dispose(); 
        homepageFrame = null;         
    }
      
    /* 
     * Frames being created.
     * Inside the frames, individual buttons are created 
     */ 
   
   
    /* creates a sign in frame */ 
    private void signinFrame() {
      signinFrame = new JFrame("SignIn");
      signinFrame.setSize(350, 320);
      signinFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
      signinFrame.setVisible(true);
    } 
    
    /* creates a sign up frame */  
    private void signupFrame() {
      signupFrame = new JFrame("SignUp");
      signupFrame.setSize(350, 320);
      signupFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
      signupFrame.setVisible(true);
    }
    
        /* Creates a homepage frame */ 
    private void homepageFrame() { 
      homepageFrame = new JFrame("Homepage"); 
      homepageFrame.setSize(350, 320); 
      homepageFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); 
      homepageFrame.setVisible(true);
      
      /* creates a button called tacobell */ 
      tacobellButton = new JButton("Taco Bell");
      tacobellButton.setActionCommand("TacoBell");
      tacobellButton.addActionListener(this); 
      contentPane.add(Box.createRigidArea(new Dimension(0, 15)));
      JPanel contentPanel = new JPanel(); 
      contentPanel.add(tacobellButton);
      homepageFrame.add(contentPanel);   
      
      /* creates a button called mcdonald */ 
      mcdonaldButton = new JButton("Mcdonald");
      mcdonaldButton.setActionCommand("Mcdonald");
      mcdonaldButton.addActionListener(this); 
      contentPane.add(Box.createRigidArea(new Dimension(0, 15)));
      JPanel contentPanel = new JPanel(); 
      contentPanel.add(mcdonaldButton);
      homepageFrame.add(contentPanel);
      
      /* creates a button called Arby's */ 
      arbysButton = new JButton("Arby's");
      arbysButton.setActionCommand("Arby's");
      arbysButton.addActionListener(this); 
      contentPane.add(Box.createRigidArea(new Dimension(0, 15)));
      JPanel contentPanel = new JPanel(); 
      contentPanel.add(arbysButton);
      homepageFrame.add(contentPanel);
      
      /* creates a button called subway */ 
      subwayButton = new JButton("Subway");
      subwayButton.setActionCommand("Subway");
      subwayButton.addActionListener(this); 
      contentPane.add(Box.createRigidArea(new Dimension(0, 15)));
      JPanel contentPanel = new JPanel(); 
      contentPanel.add(subwayButton);
      homepageFrame.add(contentPanel);
      
      /* creates a button called wendy's */ 
      wendysButton = new JButton("Wendy's");
      wendysButton.setActionCommand("Wendy's");
      wendysButton.addActionListener(this); 
      contentPane.add(Box.createRigidArea(new Dimension(0, 15)));
      JPanel contentPanel = new JPanel(); 
      contentPanel.add(wendysButton);
      homepageFrame.add(contentPanel);
      
      /* creates a button called Harvey's */
      harveysButton = new JButton("Harvey's");
      harveysButton.setActionCommand("Harvey's");
      harveysButton.addActionListener(this); 
      contentPane.add(Box.createRigidArea(new Dimension(0, 15)));
      JPanel contentPanel = new JPanel(); 
      contentPanel.add(harveysButton);
      homepageFrame.add(contentPanel);
      
      /* creates a button called dairy queen */ 
      dairyqueenButton = new JButton("Dairy Queen");
      dairyqueenButton.setActionCommand("Dairy Queen");
      dairyqueenButton.addActionListener(this); 
      contentPane.add(Box.createRigidArea(new Dimension(0, 15)));
      JPanel contentPanel = new JPanel(); 
      contentPanel.add(dairyqueenButton);
      homepageFrame.add(contentPanel);
      
      /* Creates a button called new york fries */ 
      newyorkfriesButton = new JButton("New York Fries");
      newyorkfriesButton.setActionCommand("New York Fries");
      newyorkfriesButton.addActionListener(this); 
      contentPane.add(Box.createRigidArea(new Dimension(0, 15)));
      JPanel contentPanel = new JPanel(); 
      contentPanel.add(newyorkfriesButton);
      homepageFrame.add(contentPanel);
      
      /* Creates a button called pizza pizza */ 
      pizzapizzaButton = new JButton("Pizza Pizza");
      pizzapizzaButton.setActionCommand("Pizza Pizza");
      pizzapizzaButton.addActionListener(this); 
      contentPane.add(Box.createRigidArea(new Dimension(0, 15)));
      JPanel contentPanel = new JPanel(); 
      contentPanel.add(pizzapizzaButton);
      homepageFrame.add(contentPanel);
      
      /* creates a button called KFC */ 
      kfcButton = new JButton("KFC");
      kfcButton.setActionCommand("KFC");
      kfcButton.addActionListener(this); 
      contentPane.add(Box.createRigidArea(new Dimension(0, 15)));
      JPanel contentPanel = new JPanel(); 
      contentPanel.add(kfcButton);
      homepageFrame.add(contentPanel);
    } 

    /* creates a tacobell frame */ 
    private void tacobellFrame() {
      tacobellFrame = new JFrame("Taco Bell");
      tacobellFrame.setSize(350, 320);
      tacobellFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
      tacobellFrame.setVisible(true);
      
    } 
    
    /* creates a mcdonald frame */ 
    private void mcdonaldFrame() {
      mcdonaldFrame = new JFrame("Mcdonald");
      mcdonaldFrame.setSize(350, 320);
      mcdonaldFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
      mcdonaldFrame.setVisible(true);

    } 
    
   /* creates a arby's frame */ 
    private void arbysFrame() {
      arbysFrame = new JFrame("Arby's");
      arbysFrame.setSize(350, 320);
      arbysFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
      arbysFrame.setVisible(true);
    } 
    
    /* creates a subway frame */ 
    private void subwayFrame() {
      subwayFrame = new JFrame("Subway");
      subwayFrame.setSize(350, 320);
      subwayFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
      subwayFrame.setVisible(true);
    } 
    
    /* creates a burger king frame */
    private void burgerkingFrame() {
      burgerkingFrame = new JFrame("Burger King");
      burgerkingFrame.setSize(350, 320);
      burgerkingFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
      burgerkingFrame.setVisible(true);
    } 
    
    /* creates a wendy's frame */ 
    private void wendysFrame() {
      wendysFrame = new JFrame("Wendy's");
      wendysFrame.setSize(350, 320);
      wendysFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
      wendysFrame.setVisible(true);
    } 
    
    /* creates a harvey's frame */ 
    private void harveysFrame() {
      harveysFrame = new JFrame("Harvey's");
      harveysFrame.setSize(350, 320);
      harveysFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
      harveysFrame.setVisible(true);
    } 
    
    /* creates a dairy queen frame */ 
    private void dairyqueenFrame() {
      dairyqueenFrame = new JFrame("Dairy Queen");
      dairyqueenFrame.setSize(350, 320);
      dairyqueenFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
      dairyqueenFrame.setVisible(true);
    } 
    
    /* creates a new york fries frame */ 
    private void newyorkfriesFrame() {
      newyorkfriesFrame = new JFrame("New York Fries");
      newyorkfriesFrame.setSize(350, 320);
      newyorkfriesFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
      newyorkfriesFrame.setVisible(true);
    } 
    
    /* creates a pizza pizza frame */ 
    private void pizzapizzaFrame() {
      pizzapizzaFrame = new JFrame("Pizza Pizza");
      pizzapizzaFrame.setSize(350, 320);
      pizzapizzaFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
      pizzapizzaFrame.setVisible(true);
    } 

    /* creates a kfc frame */
    private void kfcFrame() {
      kfcFrame = new JFrame("KFC");
      kfcFrame.setSize(350, 320);
      kfcFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
      kfcFrame.setVisible(true);
      
      
    } 
            
    
    }

    class Terminate implements ActionListener {
      public void actionPerformed(ActionEvent event) {
      System.exit(0);
    }
    }

    public static void main(String[] args) {
      javax.swing.SwingUtilities.invokeLater(new Runnable() {
        public void run() {
          runGUI();
        }
      });
    }
  }

Errors in your code because you have Declared and initialized your JPanel contanentPanel many time. So remove all declaration's

JPanel contentPanel = new JPanel();

leaving only the first one

Secondly Now you need to declare your homepage as JFrame instead of JButton.

This wil remove all your errors.

For Layout read the tutorial. You can use Box Layout or GridBagLayout

Errors in your code because you have Declared and initialized your JPanel contanentPanel many time. So remove all declaration's

JPanel contentPanel = new JPanel();

leaving only the first one

Secondly Now you need to declare your homepage as JFrame instead of JButton.

This wil remove all your errors.

For Layout read the tutorial. You can use Box Layout or GridBagLayout

ok. when I compile apparently it doesn't show the errors on the JPanel stuff. it highlights the errors in all the "Private void tacobell();", "private void signin();" etcetc...

the error says:
[line: 266]
Error: C:\Documents and Settings\HP_Administrator\Desktop\RestaurantFirstPage1.java:266: ';' expected

This article has been dead for over six months. Start a new discussion instead.