Error in compiling

Discussion in 'Java' started by Gaurav Tiwari, Jun 5, 2004.

  1. 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 ;
    }



    }
    Gaurav Tiwari, Jun 5, 2004
    #1
    1. Advertising

  2. On 5 Jun 2004 06:00:58 -0700, Gaurav Tiwari wrote:

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

    ...
    > public boolean action(Event event,Object arg)


    <http://java.sun.com/j2se/1.4.2/docs/api/java/awt/Component.html#method_summary>

    Check under that for 'action(Event, Object)'..

    You might also consider posting to
    a different group for the moment..
    <http://www.physci.org/codes/javafaq.jsp#cljh>

    HTH

    --
    Andrew Thompson
    http://www.PhySci.org/ Open-source software suite
    http://www.PhySci.org/codes/ Web & IT Help
    http://www.1point1C.org/ Science & Technology
    Andrew Thompson, Jun 5, 2004
    #2
    1. Advertising

  3. Gaurav Tiwari

    Ryan Stewart Guest

    "Gaurav Tiwari" <> wrote in message
    news:...
    > 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.
    Ryan Stewart, Jun 5, 2004
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    2
    Views:
    384
    Ian Collins
    Feb 13, 2007
  2. Replies:
    2
    Views:
    372
    John Harrison
    Feb 13, 2007
  3. Garrett Cooper
    Replies:
    0
    Views:
    543
    Garrett Cooper
    Feb 24, 2009
  4. Garrett Cooper
    Replies:
    0
    Views:
    487
    Garrett Cooper
    Feb 24, 2009
  5. Lon Baker
    Replies:
    1
    Views:
    214
    Csaba Henk
    Mar 21, 2005
Loading...

Share This Page