codetoad.com
  ASP Shopping CartForum & BBS
  - all for $20 from CodeToad Plus!
  
  Home || ASP | ASP.Net | C++/C# | DHTML | HTML | Java | Javascript | Perl | VB | XML || CodeToad Plus! || Forums || RAM 
Search Site:
Search Forums:
  Login Box for a tab  rossm at 10:01 on Wednesday, January 31, 2007
 

Hi im making a small system. I need to created a username and password box to allow a user to view a tab. Im fairly new to jave and im not sure how i would do it.

Could someone help me?

thanks

  Re: Login Box for a tab  mmarab at 10:02 on Thursday, February 01, 2007
 

If you wish to provide a graphical login dialog box for your application, you can use the AWT's TextField class, which is a text component that allows the editing of a single line of text. To mask the password field, use the setEchoChar method. For example, to set the echo char to an asterisk, you would do:

TextField password = new TextField(8);
password.setEchoChar('*');

But i would recomment using swing, use the JPassword Field the api link is:

http://java.sun.com/j2se/1.4.2/docs/api/javax/swing/JPasswordField.html

This is how simple it is to set up:

passwordField = new JPasswordField(10);
passwordField.setActionCommand(OK);
passwordField.addActionListener(this);

This will get you started!











CodeToad Experts

Can't find the answer?
Our Site experts are answering questions for free in the CodeToad forums








Recent Forum Threads
•  close window
•  Passing Variable To js File
•  Re: Compiling JAVA code in .NET?
•  managed nd unmanaged code..
•  Looking for free form submit php script?
•  horizontal scroll of images
•  Re: DHTML : popup slider using image
•  Re: Java question - zoom/selection
•  Re: Login Box for a tab


Recent Articles
ASP GetTempName
Decode and Encode UTF-8
ASP GetFile
ASP FolderExists
ASP FileExists
ASP OpenTextFile
ASP FilesystemObject
ASP CreateFolder
ASP CreateTextFile
Javascript Get Selected Text


© Copyright codetoad.com 2001-2007