Can anyone help with the code for printing a password and username to console.I have my passwordField pas with an action listener but wnat to get it printined to the console. Using version JDK1.5.Have tried some of the methods in the documentation but am getting errors.
What errors are you getting. Compile-time errors or run-time errors. Also, what is your code?
In general, you print to the console using: System.out.println(string) or System.out.print(string). If what you are printing is not a string, then you can override toString() for your class and the object will automatically be converted to a string as needed.
I promise I will be the best, most loyal friend ever! All for this tiny ad: