• Embed Doc
  • Readcast
  • Collections
  • CommentGo Back
Download
 
NetBeans Platform Login Tutorial
This tutorial demonstrates how to create a login form for a NetBeans Platform application with very simple user and password management. The login will be implemented with the
DialogDisplayer
class of the NetBeans APIs.The dialog that you create in this tutorial will be visible whenever the user starts the application. The passwords and usernames will be stored in a preferences file, which is notvery safe. Therefore, this tutorial will provide a solution to encrypt the passwords with "Message-Digest Algorithm 5" (MD5). MD5 is a cryptographic hash-function invented byRoland L. Rivest. To use MD5 in our application, the
java.security
package will help us.
Contents
Installing The Software
 
Before you begin, you need to install the following software on your computer:
 
NetBeans IDE 6.0 (download) 
 
Java Standard Development Kit (JDK™) version 1.4.2 (
download)or 5.0(download) or later
Setting Up The Module Suite
The first thing you have to do is to create a sample project. We will use a Module Suite. Here you can use the wizard that the IDE provides.1.
 
Choose File > New Project (Ctrl-Shift-N). Under Categories, select NetBeans Modules. Under projects, select
 Module Suite
and click Next.2.
 
In the next panel you have to give the suite a proper name, such as
LoginSuite
, and set the location to any directory on your computer. Click Finish.3.
 
Now the IDE has created an empty suite for you. You can even test it when you right-click the module suite name and choose run. There will start a whole new IDE. Butwe do not need a complete IDE. So if you like, you can make the start of your application faster by following these few optional steps:4.
 
Right-click the module suite name. Choose 'Properties'. Select 'Libraries'. Now you see on the right side a list of 'Platfom Modules'. Deselect all except of 'platform7'.Click OK.5.
 
If you run the application again there will only be a window with the essential buttons and menus. It should look like this:
 
 
Creating A Simple User And Password Management
To have as little work as possible, we will use some very interesting features of NetBeans IDE to create our simple user management. This management will only be able to storeone username and one password in a preferences file.
Create Option Panel For The User Management
In this section we will show you how to create an option panel to handle your username and password.1.
 
At first we create a new module by right-clicking on the Modules folder in our suite and choosing
 Add New...
.
of 00

Leave a Comment

You must be to leave a comment.
Submit
Characters: ...
You must be to leave a comment.
Submit
Characters: ...