Monday, 5 August 2013

HOW TO MAKE SALARY CALCULATOR    USE THE FOLLOWING SCRIPT IN NETBEANS AND CHANGE TEXTFEILD NAME ACORDINGLY





SCRIPT FOR CALCULATION BUTTON
                               
        float b=Float.parseFloat(txtb.getText());
        float hrr=Float.parseFloat(txthrr.getText());
        float dar=Float.parseFloat(txtdar.getText());
        float tax=Float.parseFloat(txttax.getText());
        float  hra=0,da=0,g=0,mg=0,ai=0,nsal=0,mtax=0;

        
         hra=(b*hrr)/100;
         da=(b*dar)/100;
  
        g=b+hra+da;

        ai=g*12;
        
        tax=(g*tax)/100;

       

        mtax=tax/12;
        nsal=g-mtax;

        txth.setText(""+hra);
        txtd.setText(""+da);
        txtg.setText(""+g);
        txtt.setText(""+tax);
        txtmt.setText(""+mtax);
        txtn.setText(""+nsal);




SCRIPT FOR CLEAR BUTTON

        txtb.setText("");
        txth.setText("");
        txtd.setText("");
        txtg.setText("");
        txtt.setText("");
        txtmt.setText("");
        txtn.setText("");
        txthrr.setText("");
        txtdar.setText("");
        txttax.setText("");




SCRIPT FOR EXIT BUTTON


System.exit(0);








YOU CAN DOWNLOAD ITS JAR FILE VIA FOLLOWING LINK
1. JAR FILE 



Sunday, 4 August 2013

HOW TO MAKE FACTORIAL    USE THE FOLLOWING SCRIPT IN NETBEANS AND CHANGE TEXTFEILD NAME ACORDINGLY








SCRIPT FOR SUBMIT BUTTON


int n=Integer.parseInt(jTextField1.getText());
        int i,factorial=1;
         for (i=1;i<=n;i++)
         {
         factorial=i*factorial;
               
         }
        System.out.println(factorial);
        




                                          

Saturday, 3 August 2013

HOW TO CHECK WHEATHER DATA (TEXT,NUMERIC)  IS A PALINDRONE OR NOT    USE THE FOLLOWING SCRIPT IN NETBEANS AND CHANGE TEXTFEILD NAME ACORDINGLY





SCRIPT  FOR OK BUTTON

        String s=jTextField1.getText();
        int i;
        int n=s.length();
        String str="";
        for(i=n-1;i>=0;i--)
        str=str+s.charAt(i);
        if (str.equals(s))
       JOptionPane.showMessageDialog(this,s+" "+"is a palindrone");
        else
           JOptionPane.showMessageDialog(this,s+" "+"is not a palindrone");


SCRIPT FOR CLEAR BUTTON


   jTextField1.setText("");
        System.out.println("");







                                               

Friday, 2 August 2013

HOW TO REVERSE  AN  INTEGER NUMBER    USE THE FOLLOWING SCRIPT IN NETBEANS AND CHANGE TEXTFEILD NAME ACORDINGLY







SCRIPT FOR REVERSE BUTTON



   int n=Integer.parseInt(txt1.getText());
        int reserve=0; int r=0;
        while (n!=0)                                                  
        {
            r=(n%10);

            n=n/10;

            r = r+reserve;

            txtresult.append(r+"");                  
         
        }


             

Thursday, 1 August 2013

SIMPLE EMI CALCULATOR USE THE FOLLOWING SCRIPT IN NETBEANS AND CHANGE TEXTFEILD NAME ACORDINGLY


SCRIPT FOR SUBMIT BUTTON

    double p=Double.parseDouble(txtp.getText());      // TO TAKE PRINCIPLE
    double t=Double.parseDouble(txtt.getText());       // TO TAKE TIME IN YEARS
    double r=Double.parseDouble(txtr.getText());      // TO TAKE RATE OF INTEREST

     
        double i=(p*r*t)/100;                                    // FORMULA OF SIMPLE INETEREST
        txti.setText(""+i);                                         // TO SHOW INTEREST
        double a=p+i;                                              // FORMULA FOR TOTAL AMMOUNT
        txta.setText(""+a);                                       //TO SHOW TOTAL AMMOUNT
        double e=a/(t*12);                                       //FORMULA OF SIMPLE EMI
        txte.setText(""+e);                                       //TO SHOW EMI





SCRIPT FOR CLEAR BUTTON


        txtr.setText("");                                           //TO CLEAR RATE TEXT FEILD
        txtp.setText("");                                          // TO CLEAR PRINCIPLE TEXT FEILD
        txtt.setText("");                                          // TO CLEAR TIME TEXT FEILD
        txti.setText("");                                          // TO CLEAR INTEREST TEXT FEILD
        txta.setText("");                                         // TO CLEAR AMMOUNT TEXT FEILD
        txte.setText("");                                         // TO CLEAR EMI TEXT FEILD




SCRIPT FOR EXIT BUTTON

System.exit(0);                                                // TO EXIT PROGRAM













Wednesday, 31 July 2013

SIMPLE CALCULATOR USE THE FOLLOWING SCRIPT IN NETBEANS AND CHANGE TEXTFEILD NAME ACORDINGLY

















SCRIPT FOR  +  BUTTON




if (txtnum1.getText().isEmpty())
    JOptionPane.showMessageDialog(this,"THIS FEILD CANNOT LEFT EMPTY");

if (txtnum2.getText().isEmpty())
    JOptionPane.showMessageDialog(this,"THIS FEILD CANNOT LEFT EMPTY");

float num=Float.parseFloat(txtnum1.getText());
float num2=Float.parseFloat(txtnum2.getText());
float res=0;
res =num+num2;

txtres.setText(res+"");


SCRIPT FOR  -  BUTTON



if (txtnum1.getText().isEmpty())
    JOptionPane.showMessageDialog(this,"THIS FEILD CANNOT LEFT EMPTY");

if (txtnum2.getText().isEmpty())
    JOptionPane.showMessageDialog(this,"THIS FEILD CANNOT LEFT EMPTY");

        
float num=Float.parseFloat(txtnum1.getText());
float num2=Float.parseFloat(txtnum2.getText());



float res=0;
res =num-num2;

txtres.setText(res+"");



SCRIPT FOR  X  BUTTON




if (txtnum1.getText().isEmpty())
    JOptionPane.showMessageDialog(this,"THIS FEILD CANNOT LEFT EMPTY");

if (txtnum2.getText().isEmpty())
    JOptionPane.showMessageDialog(this,"THIS FEILD CANNOT LEFT EMPTY");

        
float num=Float.parseFloat(txtnum1.getText());
float num2=Float.parseFloat(txtnum2.getText());



float res=0;
res =num*num2;

txtres.setText(res+"");


SCRIPT FOR  ÷  BUTTON


if (txtnum1.getText().isEmpty())
    JOptionPane.showMessageDialog(this,"THIS FEILD CANNOT LEFT EMPTY");

if (txtnum2.getText().isEmpty())
    JOptionPane.showMessageDialog(this,"THIS FEILD CANNOT LEFT EMPTY");

        
float num=Float.parseFloat(txtnum1.getText());
float num2=Float.parseFloat(txtnum2.getText());



float res=0;
res =num/num2;

txtres.setText(res+"");

SCRIPT FOR  clear  BUTTON






txtnum1.setText("");
txtnum2.setText("");
txtres.setText("");



SCRIPT FOR  exit  BUTTON



System.exit(0);







Tuesday, 30 July 2013

TO CHECK UR BMI INDEX USE THE FOLLOWING SCRIPT IN NETBEANS AND CHANGE TEXTFEILD NAME ACORDINGLY


(1FT=3.48 CM)
FOR CALCULATE BUTTON :

tring name=jTextField1.getText();                                            // TO TAKE NAME
float w=Float.parseFloat(jTextField2.getText());                    // TO TAKE WEIGHT OF THAT PERSON
float h=Float.parseFloat(jTextField3.getText());  // TO TAKE HEIGHT OF THAT PERSON (IN
                                                                                                                                                  METERS)
float bmi=0;
bmi=w/(h*h);
jTextField4.setText(bmi+" ");                           //TO GIVE BMI RESULT





if (optm.isSelected())  // optm is radio button male name
{
    if (bmi<17.5)
   JOptionPane.showMessageDialog(this,name+" you is anorexia");
    else if (bmi>=17.5&&bmi<20.7)
    JOptionPane.showMessageDialog(this,name+" you is underweight");
else if (bmi>=20.7&&bmi<26.4)
    JOptionPane.showMessageDialog(this,name +" you is in normal range");
else if (bmi>=26.4&&bmi<27.8)
    JOptionPane.showMessageDialog(this,name +" you is marginally overweight");
else if (bmi>=27.8&&bmi<31.1)
    JOptionPane.showMessageDialog(this,name +" you is overweight");
else if (bmi>=31.1&&bmi<35)
    JOptionPane.showMessageDialog(this,name +" you is very overweight or obese");
else if (bmi>=35&&bmi<40)
    JOptionPane.showMessageDialog(this,name +" you is severely obese");
else if (bmi>=40&&bmi<50)
    JOptionPane.showMessageDialog(this,name +" you is morbidly obese");
else if (bmi>=50&&bmi<60)
    JOptionPane.showMessageDialog(this,name +" you is super obese");

}
else if (optf.isSelected())                                         // optm is radio button female name
{
    if (bmi<17.5)
   JOptionPane.showMessageDialog(this,name+" you is anorexia");
    else if (bmi>=17.5&&bmi<19.1)
    JOptionPane.showMessageDialog(this,name+" you is underweight");
else if (bmi>=19.1&&bmi<25.8)
    JOptionPane.showMessageDialog(this,name +" you is in normal range");
else if (bmi>=25.8&&bmi<27.3)
    JOptionPane.showMessageDialog(this,name +" you is marginally overweight");
else if (bmi>=27.3&&bmi<32.3)
    JOptionPane.showMessageDialog(this,name +" you is overweight");
else if (bmi>=32.3&&bmi<35)
    JOptionPane.showMessageDialog(this,name +" you is very overweight or obese");
else if (bmi>=35&&bmi<40)
    JOptionPane.showMessageDialog(this,name +" you is severely obese");
else if (bmi>=40&&bmi<50)
    JOptionPane.showMessageDialog(this,name +" you is morbidly obese");
else if (bmi>=50&&bmi<60)
    JOptionPane.showMessageDialog(this,name +" you is super obese");

}


TO CLEAR ALL TEXT FROM TEXT BOX USE  FOLLOWING SCRIPT :

txtn.setText(" ");
txth.setText(" ");
txtw.setText(" ");
optm.setSelected(false);  
optf.setSelected(false);
txtbmi.setText(" ");

 TO CLOSE THE APPLICATION USE THE FOLLOWING SCRIPT :

System.exit(0);



IF YOU WANT TO KNOW MORE ,YOU CAN READ THESE BOOKS