Wfranc
March 19th, 2003, 03:00 AM
I have a sample code below, could you help me find out what needs to be changed or included in order that the program can run.:D Sorry for my question, but I.... really need your help. and really thankful if you could give me some instructions about it:)
import java.applet.Applet;
import java.awt.*;
import java.awt.event.*;
public class soleil:D extends Applet implements ActionListener {
Label promts;
TextField input;
int number;
int sum;
public void init(){
promts=new Label("Enter babie:");
add(promts);
input=new TextField(10);
add(input);
sum=0;
input.addActionListener(this);
}
public void actionPerformed(ActionEvent e){
number=Integer.parseInt(e.getActionCommand());
sum=sum+number;
input.setText(" ");
showStatus(Integer.toString(sum));
}
}
import java.applet.Applet;
import java.awt.*;
import java.awt.event.*;
public class soleil:D extends Applet implements ActionListener {
Label promts;
TextField input;
int number;
int sum;
public void init(){
promts=new Label("Enter babie:");
add(promts);
input=new TextField(10);
add(input);
sum=0;
input.addActionListener(this);
}
public void actionPerformed(ActionEvent e){
number=Integer.parseInt(e.getActionCommand());
sum=sum+number;
input.setText(" ");
showStatus(Integer.toString(sum));
}
}