Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2010
    Posts
    17
    Rep Power
    0

    Question How to fix Deprecated ApI warning in java program

    I make the following programs,when i compile the error comes:

    Error:C1.java uses or override a deprecated API ,Recompile with -Xlint:deprecation for detailes;



    import java.awt.*;

    class C1 extends Frame
    {
    C1()
    {

    Label l1,l2;
    TextField t1,t2;
    l1=new Label("Name");
    l2=new Label("Qual");
    t1=new TextField(30);
    t2=new TextField(30);
    set.Layout(null);
    l1.setBounds(20,20,50,30);
    l2.setBounds(20,130,50,30);
    t1.setBounds(50,50,30,30);
    t1.setBounds(150,130,30,30);
    add(l1);
    add(l2);
    add(t1);
    add(t2);
    show();




    }

    public static void main(String args[])
    {
    new C1();
    }
    }



    Somebody help///

  2. #2
    curmudgeon is offline Senior Member
    Join Date
    May 2010
    Posts
    436
    Rep Power
    5

    Default

    Read the Java API for that class and that method. It will usually tell you what to do instead. In this case likely the class will be Frame and the method show().

    Also, if you don't have a contraindication towards doing so, I strongly urge you to change from an AWT GUI to a Swing GUI and that you look into using layout managers rather than a null layout.

    Suerte amigo!

  3. #3
    curmudgeon is offline Senior Member
    Join Date
    May 2010
    Posts
    436
    Rep Power
    5

    Default

    Also, you may wish to reply to the several answers you received in your thread from June 9th.

    Otra vez, suerte!

Similar Threads

  1. Dont use this program, Im warning you!
    By Addez in forum JCreator
    Replies: 3
    Last Post: 11-28-2009, 08:18 PM
  2. deprecated method.. help!
    By iuna in forum Java Applets
    Replies: 11
    Last Post: 09-08-2008, 09:38 PM
  3. Java Security Warning
    By Neil in forum New To Java
    Replies: 3
    Last Post: 09-01-2008, 05:15 PM
  4. I need help with a deprecated program
    By mikau in forum New To Java
    Replies: 0
    Last Post: 02-13-2008, 10:34 AM
  5. Using Deprecated Methods
    By ravian in forum New To Java
    Replies: 3
    Last Post: 11-23-2007, 08:58 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •