Click to See Complete Forum and Search --> : dumb newb with dumb question


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));
}
}

dlorde
March 19th, 2003, 09:39 AM
What is the program supposed to do?

What is going wrong with it?

Do you get any error messages?

BTW you missed out the comments in the code.

To get the right answer, you must ask the right question...

Wfranc
March 19th, 2003, 09:59 AM
Thank you for your reply dlorde,
My program when compiled has no error. The user will input text in the textfield after the applet is loaded.
My problem is that even when I already used ApplerViewer command to execute the soleil.html file, there was no applet loaded, so I pulled my hair to figure out whats wrong with it but I havenot found out the answer so far. I dont know much about Java, so please help...

Nemi
March 19th, 2003, 11:54 AM
We need to see your html page also.