Results 1 to 3 of 3
- 05-27-2012, 11:22 PM #1
Member
- Join Date
- May 2012
- Posts
- 15
- Rep Power
- 0
JPasswordField show a default text ?
Hi all

I want to know how to show a default message in a JPasswordField box something like "At least 8 chars", let me show you.
If it do this:
It shows this " ************* " instead of the text.Java Code:passBox=new JPasswordField("At least 8 chars");
So I want this to show me the default message but also and very important I want this to hide the password when the users start to type it.
(I've already added a MouseListener so when the users click on the password field, they don't need to delete the default text).
Thanks in advance
- 05-27-2012, 11:26 PM #2
Moderator
- Join Date
- Jul 2010
- Location
- California
- Posts
- 1,608
- Rep Power
- 5
Re: JPasswordField show a default text ?
See the API for JPasswordField, the setEchoChar allows you to set a value (0) that indicates you wish to see the text...change this '*' when the user clicks the component.
- 05-28-2012, 01:12 AM #3
Member
- Join Date
- May 2012
- Posts
- 15
- Rep Power
- 0
Similar Threads
-
Java text boxes does not show
By zAxOanL in forum New To JavaReplies: 0Last Post: 03-25-2012, 04:08 AM -
get text and show it and save it
By pinar.n in forum AWT / SwingReplies: 1Last Post: 07-03-2011, 07:05 PM -
show text file to textArea
By louboulos in forum New To JavaReplies: 14Last Post: 06-12-2011, 01:16 PM -
Show Text with cursor
By ravjot28 in forum AWT / SwingReplies: 3Last Post: 01-20-2010, 09:30 PM -
Opening Text Files with Default System Editor
By Pesch in forum Advanced JavaReplies: 5Last Post: 10-08-2008, 06:17 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks