java programming help

weezergirl

Diamond Member
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(&quot;-10<A<10:&quot;, JLabel.EAST);
labelbottom2 = new JLabel(&quot;0<=maxX:&quot;, JLabel.EAST);
plotbutton=new JButton(&quot;Plot&quot;);
clearbutton=new JButton(&quot;Clear&quot;);
text1= new JTextField(&quot;1.0&quot;);
text1.setHorizontalAlignment(JTextField.CENTER);
text2 = new JTextField(&quot;0.5&quot;);
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, &quot;North&quot;);
c.add(bottompanel, &quot;South&quot;);
}


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 :)
 

Asif

Golden Member
Oct 25, 2000
1,276
0
0
remove the colons?


<< JLabel(&quot;-10<A<10:&quot;, JLabel.EAST); >>




<< new JLabel(&quot;0<=maxX:&quot;, JLabel.EAST); >>

 

weezergirl

Diamond Member
May 24, 2000
3,366
1
0
oh actually that was part of the string, but i think i figured it out. it has to do with the EAST. how do u right justify?? i thought it was EAST...oh well let me look it up. '

oh ok. it's right. duhhh. hehe
 

Asif

Golden Member
Oct 25, 2000
1,276
0
0
i don't know jack about java, never have drank coffee

figured it was like html and the littles stuff throws it all off
 

AmazonRasta

Banned
Dec 2, 2000
2,005
1
0
I'm taking java programming right now in Grade 12 computer science. Personally, I hate it. It's buggy. We've been spending a whole semester trying to get a couple of balls to bounce around on screen.

Sorry though, I can't help you. Good luck.