- May 24, 2000
- 3,366
- 1
- 0
blah, i need help guys. here is the code:
public void init() {
Container c = getContentPane();
c.setLayout(new BorderLayout());
//make plot button
labeltop=new JLabel("Y=X*sin(1/(X^A))", JLabel.CENTER);
labelbottom1 = new JLabel("-10<A<10:", JLabel.EAST);
labelbottom2 = new JLabel("0<=maxX:", JLabel.EAST);
plotbutton=new JButton("Plot"
clearbutton=new JButton("Clear"
text1= new JTextField("1.0"
text1.setHorizontalAlignment(JTextField.CENTER);
text2 = new JTextField("0.5"
text2.setHorizontalAlignment(JTextField.CENTER);
bottompanel = new JPanel(new GridLayout(2,3));
bottompanel.add(plotbutton);
bottompanel.add(labelbottom1);
bottompanel.add(text1);
bottompanel.add(clearbutton);
bottompanel.add(labelbottom2);
bottompanel.add(text2);
c.add(labeltop, "North"
c.add(bottompanel, "South"
}
for some reason i can't add labelbottom1 and labelbottom2 onto the bottom panel. the program will compile correctly but when i view the applet it says it hasn't been initialized yet?! but when i leave those 2 labels out it works fine. why?!?!?! this is driving me crazy. thanks for any help or suggestions
public void init() {
Container c = getContentPane();
c.setLayout(new BorderLayout());
//make plot button
labeltop=new JLabel("Y=X*sin(1/(X^A))", JLabel.CENTER);
labelbottom1 = new JLabel("-10<A<10:", JLabel.EAST);
labelbottom2 = new JLabel("0<=maxX:", JLabel.EAST);
plotbutton=new JButton("Plot"
clearbutton=new JButton("Clear"
text1= new JTextField("1.0"
text1.setHorizontalAlignment(JTextField.CENTER);
text2 = new JTextField("0.5"
text2.setHorizontalAlignment(JTextField.CENTER);
bottompanel = new JPanel(new GridLayout(2,3));
bottompanel.add(plotbutton);
bottompanel.add(labelbottom1);
bottompanel.add(text1);
bottompanel.add(clearbutton);
bottompanel.add(labelbottom2);
bottompanel.add(text2);
c.add(labeltop, "North"
c.add(bottompanel, "South"
}
for some reason i can't add labelbottom1 and labelbottom2 onto the bottom panel. the program will compile correctly but when i view the applet it says it hasn't been initialized yet?! but when i leave those 2 labels out it works fine. why?!?!?! this is driving me crazy. thanks for any help or suggestions