can you resolve this warning?
warning: [deprecation] getText() in JPasswordField has been deprecated

3 Years
Discussion Span
Last Post by stultuske


Try to this

String testpassword = new String(passwordField.getPassword());

Have A Happy Day..,

String sql = "Select * from tbkaryawan where IDKaryawan='"+jTextField1.getText()+"'&&Password='"+ jPasswordField1.getText()+ "'";

er.. my code like this.. so how to put your code was sugested into that mode?


if you don't know that, you shouldn't bother to work with Swing GUI's and start learning the basics of OO design and Java.

for some reason, you've asked about this "all over the forum"

but, just to indulge you one last time:

String sql = "Select * from tbkaryawan where IDKaryawan='"+jTextField1.getText()+"'&&Password='"+ new String(jPasswordField1.getPassword()) + "'";

now, in the hope to give you a reality check: you seem to have trouble replacing one method by the other. you seem to have difficulties instantiating a String object. when provided with the code you need, you don't know how to copy paste it (which is basically all you needed to do).

stop working on GUI's, stop working with databases, and first make sure you have a sound knowledge of the basics. if you don't, you'll have this kind of problems every single time you're trying something you haven't done yet, and that isn't solved in the very exact same way.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.