Pessoal ,algu�m poderia me ajudar nestes tr�s applets.
ambos compilam corretamente sem erros, mas no hora de chamar o
appletviewer, aparece a mensagem applet n�o inicializado.
 
Os tr�s applets tamb�m est�o em anexo.
Obrigado antecipadamente pela ajuda.....
 

Qual ser� o erro ?
 
--------------------------------------------
import java.awt.*;
import java.applet.*;
 
public class Applet2 extends Applet
{
 TextField textField;
 
 public void init()
 {
  textField = new TextField(40);
  add(textField);
    }
 
    public void paint(Graphics g)
    {
  String s = textField.getText();
  g.drawString(s, 40, 50);
 }
 
 public boolean action(Event event, Object arg)
 {
  repaint();
  return true;
 }
}
--------------------------------------------
import java.awt.*;
import java.applet.*;
 
public class Applet4 extends Applet
{
 public void paint(Graphics g)
 {
  int x =10;
  String s = String.valueOf(x);
  g.drawString(s, 40, 50);
 }
 
}
--------------------------------------------
import java.awt.*;
import java.applet.*;
 
public class Applet5 extends Applet
{
 TextField textField1;
 TextField textField2;
 
 public void init()
 {
  textField1 = new TextField (5);
  textField2 = new TextField (5);
  add(textField1);
  add(textField2);
  textField1.setText("0");
  textField2.setText("0");
 } // fecha public void init
 
 public void paint(Graphics g)
 {
  int value1;
  int value2;
  int sum;
  g.drawString("Type a number in each box.", 40, 50);
  g.drawString("The sum of the values is:", 40, 75);
  String s = textField1.getText();
  value1 = Integer.parseInt(s);
  s = textField2.getText();
  value2 = Integer.parseInt(s);
  sum = value1 + value2;
  s = String.valueOf(sum);
  g.drawString(s, 80, 100);
 }
 
 public boolean action (Event event, Object arg)
 {
  repaint();
  return true;
 
 }
}// fecha class Applet5
-----------------------------------------------------
 
==============================================
           Kleber Rodrigo de Carvalho
       Estudante de Ci�ncia da Computa��o
         Home Page: www.krc.cjb.net 
                  UIN: 21311977
==============================================

Responder a