For Someone Really Bored!

webmasterbeta

New Member
Okay, here is the code I have come up with using everyones input. It willnot compile as it is...two errors. But I fear even if I fixed them thatit will do nothing.I'm a very Newbie going at this on my own...any advise would be great!!!!All I'm trying to accomplish is an applet where the botton does something...anything!Thanks for all the responses....also, anyone can e-mail me with tips if youwould!import java.applet.*;import java.awt.*;import java.awt.event.*;public class MemoryOne extends Applet{Label myLabel = new Label("From Memory!");outputLabel myoutputLabel = new Label("This is output to label");add(myoutputLabel);termYrs = new TextField(12);add(termYrs);public void init(){setBackground(Color.red);add(myLabel);Button myButton = new Button("YEAH!");add(myButton);}b.addActionListener(Button ActionListener)({ public void actionPerformed(ActionEvent evt){double numYears;String numYearsString;numYears = Double.parseDouble(termYrs.getText()); //for doublenumYearsString = termYrs.getText(); //for StringoutputLabel.setText("You typed " & numYearsString) //output}});}private static init(){outputLabel = new Label("This is output to label")add(outputLabel);termYrs = new TextField(12);add(termYrs);}public void paint(Graphics g){g.setColor(Color.blue);g.drawRect(0, 0,getSize().height -1,getSize().width -1);}}
 
Back
Top