Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 4 of 4

Thread: HELP! Recompile with -Xlint:unchecked for details?????

  1. #1
    Junior Member
    Join Date
    Jan 2013
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default HELP! Recompile with -Xlint:unchecked for details?????

    In the below program i got the message while compile the program.
    "note: <program name.java> uses or overrides a deprecated API." OR other are "note: recompile with -Xlint: deprecation for details."

    so, how to solve this.
    plz, tell me the..............





    import java.awt.*;
    import java.awt.event.*;

    public class RandomColorDialogDemo extends Frame implements ActionListener

    {
    public static void main(String args[])
    {
    RandomColorDialogDemo rcdd = new RandomColorDialogDemo();
    rcdd.setVisible(true);
    rcdd.setSize(200,100);


    }
    RandomColorDialogDemo()
    {
    super("Random Color Dialog Demo");

    setLayout(new FlowLayout());

    Button b = new Button("Random Color Dialog Demo");
    b.addActionListener(this);
    add(b);
    addWindowListener(new WindowAdapter (){
    public void windowClosing(WindowEvent we){
    System.exit(0);
    }
    });
    }

    public void actionPerformed(ActionEvent ae)
    {
    RandomColorDialog rcd = new RandomColorDialog(this,"Random Color Dialog",true);
    rcd.show();

    }
    }

    class RandomColorDialog extends Dialog implements ActionListener
    {
    RandomColorDialog(Frame parent,String title,boolean mode)
    {
    super(parent, title, mode);

    Panel pc = new Panel();
    Canvas canvas = new Canvas();
    canvas.setSize(100,100);

    int red = (int)(255*Math.random());
    int green = (int)(255*Math.random());
    int blue = (int)(255*Math.random());

    Color color = new Color(red,green,blue);
    canvas.setBackground(color);
    pc.add(canvas);
    add(pc,"center");


    Panel ps = new Panel();
    Button ok = new Button("OK");
    ok.addActionListener(this);
    ps.add(ok);
    add(ps,"south");

    //LAt out componets and set the initial size of this Dialog box
    pack();


    addWindowListener(new WindowAdapter(){
    public void windowClosing(WindowEvent we){
    dispose();
    }
    });
    }

    public Insets getInsets()
    {
    return new Insets(40,20,20,20);
    }

    public void actionPerformed(ActionEvent ae)
    {
    dispose();
    }
    }


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    SW Missouri
    Posts
    20,100
    Thanks
    48
    Thanked 2,153 Times in 2,126 Posts

    Default Re: HELP! Recompile with -Xlint:unchecked for details?????

    recompile with -Xlint
    The code has some statements that the compiler wants to give warning messages for.
    To see the warning messages compile the code with the javac -Xlint compiler option.
    An Example:
    D:\Java\jdk1.6.0_29\bin\javac.exe -Xlint TestCode12.java

    Please edit your post and wrap your code with
    [code=java]
    <YOUR CODE HERE>
    [/code]
    to get highlighting and preserve formatting.
    If you don't understand my answer, don't ignore it, ask a question.

  3. #3
    Junior Member
    Join Date
    Jan 2013
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: HELP! Recompile with -Xlint:unchecked for details?????

    Thanks for giving me ans. but i used this and i am not compiling and run that program the same error occurred in other program.
    so, i solve that problem permanently.
    plz, give me the solution.

  4. #4
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    SW Missouri
    Posts
    20,100
    Thanks
    48
    Thanked 2,153 Times in 2,126 Posts

    Default Re: HELP! Recompile with -Xlint:unchecked for details?????

    Did you use the javac program's -Xlint option?
    What were the messages that the javac program printed out when you compile the program?
    If you don't understand my answer, don't ignore it, ask a question.

Similar Threads

  1. Replies: 4
    Last Post: November 14th, 2012, 05:38 PM
  2. Only Constructing an Object Once (Details Inside)
    By avalanche72 in forum Object Oriented Programming
    Replies: 0
    Last Post: April 6th, 2012, 04:23 AM
  3. what is -xlint message?
    By rush7610 in forum What's Wrong With My Code?
    Replies: 1
    Last Post: October 21st, 2011, 10:36 PM
  4. HELP! Recompile with -Xlint:unchecked for details?????
    By polozelda in forum What's Wrong With My Code?
    Replies: 4
    Last Post: August 7th, 2011, 06:04 AM
  5. How to extract a particular element details which has more references ???
    By j_kathiresan in forum Algorithms & Recursion
    Replies: 1
    Last Post: December 31st, 2009, 12:11 AM