Here i'm going to explain a sample payroll application...
Step 1:-Create a welcome page like below
This is welcome page in my payroll application you can design it in your own style and here i included a progress bar and it will work when page is loaded and after that you will get a login page shown below
I will learn how to create this simple progress bar in NetBeans.This progress bar is also working based on the "Thread Concept".
Step 1:-In your design part place progress bar anywhere in your
form you can select it from Swing Controls Palette.Also you can set its properties.
Step 2:-Go to your source code part and create a inner class and implement it with Runnable interface.
Step 3:-Inside the class you can write the code below....
public class Thread1 implements Runnable /* Inner Class */
{
int i;
public void run()
{
for(i=0;i<=100;i++)
{
progbar.setValue(i);
try
{
Thread.sleep(20);
}
catch(InterruptedException ie)
{}
}
Login l=new Login(); /* Object creation of next form */
l.setVisible(true);
tfun(i);
}
}
/* function inside outer class */
public void tfun(int i)
{
if(i==101)
this.hide(); /* hide current form when progress bar completed */
}
Try this code....remaining forms will be explain in coming days...
Step 1:-Create a welcome page like below
This is welcome page in my payroll application you can design it in your own style and here i included a progress bar and it will work when page is loaded and after that you will get a login page shown below
I will learn how to create this simple progress bar in NetBeans.This progress bar is also working based on the "Thread Concept".
Step 1:-In your design part place progress bar anywhere in your
form you can select it from Swing Controls Palette.Also you can set its properties.
Step 2:-Go to your source code part and create a inner class and implement it with Runnable interface.
Step 3:-Inside the class you can write the code below....
public class Thread1 implements Runnable /* Inner Class */
{
int i;
public void run()
{
for(i=0;i<=100;i++)
{
progbar.setValue(i);
try
{
Thread.sleep(20);
}
catch(InterruptedException ie)
{}
}
Login l=new Login(); /* Object creation of next form */
l.setVisible(true);
tfun(i);
}
}
/* function inside outer class */
public void tfun(int i)
{
if(i==101)
this.hide(); /* hide current form when progress bar completed */
}
Try this code....remaining forms will be explain in coming days...


No comments:
Post a Comment