Error in compiling

G

Gaurav Tiwari

i have written the following program , but while compiling i m getting
the error as :

Note: Applet3.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.

i dont know what to do as i m in inital stages of programming plz help
..




// Applet3.java


import java.awt.*;
import java.applet.*;



public class Applet3 extends Applet
{

TextField t ;

public void init()
{
t = new TextField(20);

add(t);
}

public void paint(Graphics g)
{

String s ;
s = t.getText() ;
g.drawString(s,41,50);

}

public boolean action(Event event,Object arg)
{
repaint();
return true ;
}



}
 
R

Ryan Stewart

Gaurav Tiwari said:
i have written the following program , but while compiling i m getting
the error as :

Note: Applet3.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.

i dont know what to do as i m in inital stages of programming plz help ....
public boolean action(Event event,Object arg)
....

It's a warning, not an error. This means that your program will work fine,
but something it uses may not be supported in the future. That something is
"Event". You should use AWTEvent instead.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,143
Latest member
SterlingLa
Top