JPasswordField setText depreciation?

T

terry

Hi,

I get compile warning for the following codes:

JPasswordField jPassword1=new JPasswordField();
jPassword1.setText(pw);//<------------------this line

Recompile with -depreciation for details

How to solve this?

Thanks!
 
M

Murray

terry said:
Hi,

I get compile warning for the following codes:

JPasswordField jPassword1=new JPasswordField();
jPassword1.setText(pw);//<------------------this line

Recompile with -depreciation for details

How to solve this?

Thanks!

Are you sure it's not on the getText() method? getText() has been
deprecated, and you should use getPassword()

BTW it's deprecation not depreciation
 
M

Murray

Murray said:
Are you sure it's not on the getText() method? getText() has been
deprecated, and you should use getPassword()

BTW it's deprecation not depreciation

PS you should always consult the Javadocs to see which methods have been
deprecated. They usually tell you which method you should use instead.
 
A

Andrew Thompson

I get compile warning ..

Which compiler?
javac -version
..for the following codes:

JPasswordField jPassword1=new JPasswordField();
jPassword1.setText(pw);//<------------------this line

Recompile with -depreciation for details

That is odd, when I try a frame.show(), I get the message..
"Note: Recompile with -Xlint:deprecation for details."*,
but compiling using Java 1.5.0 indicates no (deprecation)
problem with JTextComponent.setText(String)

How to solve this?

Start with..

javac -XLint ..

--
Andrew Thompson
http://www.PhySci.org/codes/ Web & IT Help
http://www.PhySci.org/ Open-source software suite
http://www.1point1C.org/ Science & Technology
http://www.lensescapes.com/ Images that escape the mundane
 
P

Paul Lutus

terry said:
Hi,

I get compile warning for the following codes:

JPasswordField jPassword1=new JPasswordField();
jPassword1.setText(pw);//<------------------this line

Recompile with -depreciation for details

Never type in what you thought the message was. Copy the message directly
into your Usenet client. The word is "deprecation".
How to solve this?

Recoimpile with the -deprecation flag set.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,043
Latest member
CannalabsCBDReview

Latest Threads

Top