Create simple Login useing Java (Part 1)
Today I’m gonna show you how to create a Login using Java, I use Net beans IDE 7.2 for develop this application,
open the Net beans IDE and create a new java application
open the Net beans IDE and create a new java application
Go to fileànew Project or press Ctrl+Shift+N to create new Project
Then you will appear “New Project “ dialog box,
Select “Java” from categories and then select “Java Application” from “Projects” (Figure 1.1)
Name our project as “LoginApplication”(or you can give any name you like)
Default project location is Netbeans folder located in MyDocuments but you can give you own location by click “Browse” button
Click Finish
Now your project is created
You can see your project structure in Projects window
Basically java project has divided into two main parts by considering file type
1. Source file
2. Library file
Source files are stored inside packages these packages are display inside “source packages” , you can create new packages by right click on source package or any relative package.
Initially NB has created you a java class which is the main java file of the project
(as soon as you run your project JVM comes to this file, this is the main gate to the enter your project GUIs )
And there are few other windows you should know
Files window, navigator window, Services window. I’m going to explain you only the files window here, try to figure out navigator and services window ( don’t worry friends just try, I’ll explain them in my future tutorials)
Build- this file contain all the “.class” files which are created when the project compiled
Src- this file contains your all java application source files most of the time “.java” files but if you want , you can add any file as you like (ex:- images, i-report files ,etc…)
Nbproject- this file contains all the generated “ant ” and files which are relevant for open the project in Netbeans IDE , if you delete this folder you cant open the project in NB
Dist- this file has Java Archive file “.jar” file , it is a compressed file of all the class files , when ever you want to distribute your project you can use this jar file to create .exe file
Now lets start to create Login application
Right click on “loginapplication “ folder and select “New>” then select “JFrame Form”,
And name the form as “DehanLogin” or any name you like :D
Click finish
now you get a Graphical User Interface , you can shift between design view and source view using “Design and Source buttons”
Now You can design your Login window just drag and drop swing components from netbeans “palatte”
If you don’t appear NB palatte go to Window à palatte
You can change window properties using “properties” window
try to do this , lets continue remainder on part 2








0 comments :
Post a Comment