hi..
so basically my program works like this.....first frame > buttons > another frame > more buttons > lead to another frame ... but a few problems are preventing me from doing this.
p.s. I don't want to use the cardlayout because I want my buttons like a column, and I'm only showing part of the code that Im having problem with.. but if you want to see my whole program in order to solve this problem I'll post it too. :) thanks
Problems:
In my second frame I'm adding ...
1. A button, but it's not in the position that I want, like I want it more in the center and not so high up.
2. I've tried adding another button under the first button(like a column of buttons) but the second button isn't displaying. Maybe it's because of the way the position is ....
Yeaa.. can some1 help me fix this problem?
picture of the window (GUI window):
http://i47.tinypic.com/29g1kjn.jpg
this is the part of the code:
/* 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);
}