SWING API: In code, which part is deprecated? (NOT HW)

I'm hoping this is a legit post. I'm trying to learn Java/Swing on my own from a somewhat old book. (Deitel Java 3rd Edition).

I compile using standard javac compiler, and get this:

Note: LabelTest.java uses or overrides a deprecated AP

Note: Recompile with -Xlint:deprecation for details.

Can anyone tell me which Class/method is deprecated? I'm trying to pore through it line by line and look up via the online API, but nothing is really coming up...

Thanks!

-dave

here is code.

//Fig. 12.4 LabelTest.java

// Demonstrating JLabel Class

import javax.swing.*;

import java.awt.*;

import java.awt.event.*;

public class LabelTest extends JFrame {

private JLabel label1, label2, label3;

public LabelTest()

{

super( "Testing JLabel" );

Container c = getContentPane();

c.setLayout( new FlowLayout() );

//JLabel constructor with string argument

label1 = new JLabel ( "Label with text" );

label1.setToolTipText( "This is label1");

c.add( label1 );

//Jlabel contsructor with string, Icon and alignment arguments

ImageIcon bug = new ImageIcon( "bug1.gif" );

label2 = new JLabel( "Label with text and icon", bug, SwingConstants.LEFT );

label2.setToolTipText( "This is label2" );

c.add( label2 );

//JLabel Constructor no arguments

label3 = new JLabel();

label3.setText("Label wiht icon and text at bottom");

label3.setIcon(bug);

label3.setHorizontalTextPosition(SwingConstants.CENTER );

label3.setVerticalTextPosition(SwingConstants.BOTTOM);

label3.setToolTipText("This is label3");

c.add(label3);

setSize(275,170);

show();

}

public static void main(String args[])

{

LabelTest app = new LabelTest();

//app.addWindowListener(new WindowAdapter){

//public void windowClosing(WindowEvent e)

//{

//System.exit(0);

//}

//}

app.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

}

}

[2076 byte] By [drocpdpa] at [2007-11-26 18:36:54]
# 1
> Can anyone tell me which Class/method is deprecated? Thats why you got the message:Note: Recompile with -Xlint:deprecation for details.
camickra at 2007-7-9 6:10:57 > top of Java-index,Desktop,Core GUI APIs...
# 2
show();-is deprecated.
Sruthi.ma at 2007-7-9 6:10:57 > top of Java-index,Desktop,Core GUI APIs...
# 3
show() ?
DataVirtuea at 2007-7-9 6:10:57 > top of Java-index,Desktop,Core GUI APIs...
# 4
Recompile with -Xlint:deprecation for details.Can anyone tell me which Class/method is deprecated?Jeez, that's depressing :o(
itchyscratchya at 2007-7-9 6:10:57 > top of Java-index,Desktop,Core GUI APIs...
# 5

Thanks everyone.

I didn't catch that "-xlint" was a parameter in the javac command. The next post hammered it into my head, "duh, dave", and I did "javac -xlint" and actually caught that show() was deprecated in favor of

pack();

setVisible(true);

Thanks for your patience...

drocpdpa at 2007-7-9 6:10:57 > top of Java-index,Desktop,Core GUI APIs...
# 6
At least the public humiliation ensures you won't forget it next time :oD
itchyscratchya at 2007-7-9 6:10:57 > top of Java-index,Desktop,Core GUI APIs...