Results 1 to 4 of 4
  1. #1
    Mirr0ge is offline Member
    Join Date
    Mar 2011
    Posts
    4
    Rep Power
    0

    Default Another problem that needs fixing : )

    Hey Guys


    By following a tutorial I came to writing this program:
    import java.awt.Frame;
    import java.awt.Label;
    public class HowdyWindow extends Frame {
    public static void main(String arg[]) {
    new HowdyWindow();
    }
    HowdyWindow() {
    Label label;
    label=new Label("Howdy!");
    add(label);
    pack();
    show();
    }



    Again I have a compile problem:

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


    Can someone explain to me what the problem is and what to do? : )

  2. #2
    r035198x is offline Senior Member
    Join Date
    Aug 2009
    Posts
    2,388
    Rep Power
    8

    Default

    That's just a warning not an error. The warning just says that you are using very old methods and are advised to use newer ones instead.
    I'd suggest getting a more uptodate tutorial and reading it. In particular, get a Swing tutorial (from Oracle) and use that. Unless you are somehow being forced to use awt instead of Swing.

  3. #3
    Mirr0ge is offline Member
    Join Date
    Mar 2011
    Posts
    4
    Rep Power
    0

    Default

    Thank You for the quick reply : )
    I was getting frustrated not knowing what I did wrong ^^
    I'll take a look for an tutorial from Oracle thanks

  4. #4
    ozzyman's Avatar
    ozzyman is offline Senior Member
    Join Date
    Mar 2011
    Location
    London, UK
    Posts
    797
    Blog Entries
    2
    Rep Power
    4

    Default

    when an API method is deprecated, it means that it has been replaced with something new, and that you should use the new method instead because the deprecated method will soon not be supported.

    in your case, it is Window.show() that has been deprecated since Java 5.
    Java Code:
    java.awt.Window.show() 
              As of JDK 5, replaced by Component.setVisible(boolean).

Similar Threads

  1. Fixing my if statement
    By coding in forum New To Java
    Replies: 11
    Last Post: 03-01-2011, 01:56 AM
  2. Help with fixing timer
    By acash229 in forum New To Java
    Replies: 1
    Last Post: 09-13-2010, 06:27 AM
  3. [SOLVED] I need help fixing an error
    By leonardjr in forum New To Java
    Replies: 8
    Last Post: 02-21-2009, 08:33 PM
  4. help with fixing my assignment.please...error
    By Jin-enigma-PL in forum New To Java
    Replies: 4
    Last Post: 02-05-2009, 12:12 AM
  5. Exception Error need help fixing
    By skinnybones in forum New To Java
    Replies: 2
    Last Post: 12-03-2007, 07:14 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
  •