hi dear
i have problem in this code
it is very important for me please send your answers very Quicly.
import java.applet.*;
import java.awt.*;
import java.awt.event. ActionListener;
public class test1 extends Applet
{
Label enter =new Label("Enter Number 1");
Label result =new Label("Sum Is:");
TextField text=new TextField(5);
TextField output=new TextField(5);
Button calc=new Button("Calcula te");
Font font =new Font("Helvetica ",Font.BOLD,18) ;
int num,sum=0;
String s;
@Override
public void init()
{
enter.setFont(f ont);
result.setFont( font);
calc.addActionL istener(this);
text.addActionL istener(this);
add(enter);
add(text);
add(result);
add(output);
add(calc);
}
public void start()
{
text.setText("0 ");
}
public void actionPerformed (ActionEvent e)
{
num=Integer.par seInt(text.getT ext());
sum +=num;
s=String.valueO f(sum);
output.setText( "0");
text.setText("0 ");
if(num<0)
calc.setEnabled (false);
}
}
i have problem in this code
it is very important for me please send your answers very Quicly.
import java.applet.*;
import java.awt.*;
import java.awt.event. ActionListener;
public class test1 extends Applet
{
Label enter =new Label("Enter Number 1");
Label result =new Label("Sum Is:");
TextField text=new TextField(5);
TextField output=new TextField(5);
Button calc=new Button("Calcula te");
Font font =new Font("Helvetica ",Font.BOLD,18) ;
int num,sum=0;
String s;
@Override
public void init()
{
enter.setFont(f ont);
result.setFont( font);
calc.addActionL istener(this);
text.addActionL istener(this);
add(enter);
add(text);
add(result);
add(output);
add(calc);
}
public void start()
{
text.setText("0 ");
}
public void actionPerformed (ActionEvent e)
{
num=Integer.par seInt(text.getT ext());
sum +=num;
s=String.valueO f(sum);
output.setText( "0");
text.setText("0 ");
if(num<0)
calc.setEnabled (false);
}
}
Comment