Sabtu, 07 Juni 2014

Tugas Pemprograman Visual

MODUL 1
MEMBUAT PROJECT DI IDE NETBEANS




private void btampilActionPerformed(java.awt.event.ActionEvent evt) {                                       
        // TODO add your handling code here:
        JOptionPane.showMessageDialog(null,"SELAMAT MENCOBA IDE NETBEANS"+"\n"+"EDI PRAYITNO","LOGIN",JOptionPane.INFORMATION_MESSAGE);


 MODUL 2
MENGENAL LABEL,TEXTFIELD DAN BUTTON

 

private void bexitActionPerformed(java.awt.event.ActionEvent evt) {
        // TODO add your handling code here:
        dispose();
}


    private void bclearActionPerformed(java.awt.event.ActionEvent evt) {
        // TODO add your handling code here:
        txtnama.setText("");
        txtnimm.setText("");
        txtalamat.setText("");
        txtnotelp.setText("");
}

    private void btampilActionPerformed(java.awt.event.ActionEvent evt) {
        // TODO add your handling code here:
        JOptionPane.showMessageDialog(null,"EDI PRAYITNO"+"\n"+"43E57006125018"+"\n"+"PEMALANG"+"\n"+"087830685481" ,
                "LOGIN",JOptionPane.INFORMATION_MESSAGE);
 
MODUL 3
MENGENAL CARA MENDEKLARASIKAN VARIABEL DAN MENGKOVERSI VARIABEL





private void bhapusActionPerformed(java.awt.event.ActionEvent evt) {                                      
        // TODO add your handling code here:
        ebil1.setText("");
        ebil2.setText("");
        ehasil.setText("");
       
    }                                     

    private void bexitActionPerformed(java.awt.event.ActionEvent evt) {                                     
        // TODO add your handling code here:
        dispose();
    }                                     

    private void btambahActionPerformed(java.awt.event.ActionEvent evt) {                                       
        // TODO add your handling code here:
        double a,b,c;
        a = Double.parseDouble(ebil1.getText());
        b = Integer.parseInt(ebil2.getText());
        c=a+b;
        ehasil.setText(Double.toString(c));
    }                                      

    private void bkurangActionPerformed(java.awt.event.ActionEvent evt) {                                       
        // TODO add your handling code here:
      double a,b,c;
        a = Double.parseDouble(ebil1.getText());
        b = Integer.parseInt(ebil2.getText());
        c=a-b;
        ehasil.setText(Double.toString(c));
    }                                      

    private void bbagiActionPerformed(java.awt.event.ActionEvent evt) {                                     
        // TODO add your handling code here:
         double a,b,c;
        a = Double.parseDouble(ebil1.getText());
        b = Integer.parseInt(ebil2.getText());
        c=a/b;
        ehasil.setText(Double.toString(c));
    }                                    

    private void bkaliActionPerformed(java.awt.event.ActionEvent evt) {                                     
        // TODO add your handling code here:
        double a,b,c;
        a = Double.parseDouble(ebil1.getText());
        b = Integer.parseInt(ebil2.getText());
        c=a*b;
        ehasil.setText(Double.toString(c));
    }                                    


MODUL 4
MENGENAL PASSWORD FIELD DAN PERINTAH IF SEDERHANA




private void bbatallActionPerformed(java.awt.event.ActionEvent evt) {                                      

        // TODO add your handling code here:

        enimm.setText("");

        enamaa.setText("");

        enilaii.setText("");

        eketerangan.setText("");

    }                                     



    private void bkeluarrActionPerformed(java.awt.event.ActionEvent evt) {                                       

        // TODO add your handling code here:

        dispose();

    }                                       



    private void bprosessActionPerformed(java.awt.event.ActionEvent evt) {                                       

        // TODO add your handling code here:



    int a;

        String b;

        a=Integer.parseInt(enilaii.getText());

      

        eketerangan.setText(Integer.toString(a));

         if ((a>= 60)){

          

             b="lulus";

            eketerangan.setText(b);

          

         } else if ((a <60)) {

                    

         b="mengulang";

                 eketerangan.setText(b)       

}

    }                                      


MODUL 5
MENGGUNAKAN IF LEBIH DARI DUA KONDISI





private void bituActionPerformed(java.awt.event.ActionEvent evt) {                                    
        // TODO add your handling code here:
        int a,b,c,d,e;
        String f,g;
        a=Integer.parseInt(eabs.getText());
        b=Integer.parseInt(etug.getText());
        c=Integer.parseInt(euts.getText());
        d=Integer.parseInt(euas.getText());
        e=((a+b+c+d)/4);
        eang.setText(Integer.toString(e));
         if ((e>=80 && e<=100)){
           f="A";
           ehur.setText(f);
          
           g="SANGAT MEMUASKAN";
            eket.setText(g);
          
         } else if ((e>=70 && e<80)) {
             f="B";
               ehur.setText(f);
              
               g="MEMUASKAN";
                 eket.setText(g);
              
            } else if ((e>= 60 && e< 70)){
                f="C";
                  ehur.setText(f);
                 
                  g="CUKUP";
                    eket.setText(g);
                 

             } else if ((e>=50 && e<60)) {
                 f="D";
                   ehur.setText(f);
                  
                   g="KURANG";
                             eket.setText(g);
                  
             }  else if ((e>=0 && e<50)){
                 f="e";
                   ehur.setText(f);
                  
                   g="SANGAT KURANG";
                     eket.setText(g);
             }          
    }                                   

    private void bbusActionPerformed(java.awt.event.ActionEvent evt) {                                    
        // TODO add your handling code here:
        enim.setText("");
        enam.setText("");
        eabs.setText("");
        etug.setText("");
        euts.setText("");
        euas.setText("");
        eang.setText("");
        ehur.setText("");
        eket.setText("");
    }                                   

    private void bmetActionPerformed(java.awt.event.ActionEvent evt) {                                    
        // TODO add your handling code here:
        dispose();
    }                                   


MODUL 7.1
MENGGUNAKAN PERINTAH PERULANGAN FOR
 




private void bprosesActionPerformed(java.awt.event.ActionEvent evt) {
        // TODO add your handling code here:
        int a,b;
        a=Integer.parseInt(txtbilangan.getText());
        for(b=10;b<=a;b+=10){
            areahasil.append(b+".kharisma"+"\n");
        }
               
    }

    private void bbatalActionPerformed(java.awt.event.ActionEvent evt) {
        // TODO add your handling code here:
        txtbilangan.setText("");
        areahasil.setText("");
    }

    private void bkeluarActionPerformed(java.awt.event.ActionEvent evt) {
        // TODO add your handling code here:
        dispose();
    }

MODUL 7.2

MENGGUNAKAN PERINTAH PERULANGAN FOR




private void bprosesActionPerformed(java.awt.event.ActionEvent evt) {
        // TODO add your handling code here:
        int a,b;
        a=Integer.parseInt(txtbilangan.getText());
        for(b=5;a<=b;b-=1){
            areahasil.append(b+""+"\n");
        }
               
    }

    private void bbatalActionPerformed(java.awt.event.ActionEvent evt) {
        // TODO add your handling code here:
        txtbilangan.setText("");
        areahasil.setText("");
    }

    private void bkeluarActionPerformed(java.awt.event.ActionEvent evt) {
        // TODO add your handling code here:
        dispose();
    }




MODUL 7.3
MENGGUNAKAN PERINTAH PERULANGAN FOR


private void bprosesActionPerformed(java.awt.event.ActionEvent evt) {
        // TODO add your handling code here:
        int a,b;
        a=Integer.parseInt(txtbilangan.getText());
        for(b=9;a<=b;b-=3){
            areahasil.append(b+""+"\n");
        }
               
    }

    private void bbatalActionPerformed(java.awt.event.ActionEvent evt) {
        // TODO add your handling code here:
        txtbilangan.setText("");
        areahasil.setText("");
    }

    private void bkeluarActionPerformed(java.awt.event.ActionEvent evt) {
        // TODO add your handling code here:
        dispose();
    }
 


 MODUL 8.1
MENGGUNAKAN PERINTAH PERULANGAN WHILE


private void bprosesActionPerformed(java.awt.event.ActionEvent evt) {
        // TODO add your handling code here:

                Int a,b=10;
                a=Integer.parseInt(txtbilangan.getText());
                while(b<=50) {
                                areahasil.append(b+". KHARISMA"+"\n");
                                b+=10;
                }
}


private void bbatalActionPerformed(java.awt.event.ActionEvent evt) {
        // TODO add your handling code here:

                txtbilangan.setText(" ");
areahasilsetText(" ");
}

    private void bkeluarActionPerformed(java.awt.event.ActionEvent evt) {
        // TODO add your handling code here:

dispose ();
}

 MODUL 8.2

MENGGUNAKAN PERINTAH PERULANGAN WHILE

private void bprosesActionPerformed(java.awt.event.ActionEvent evt) {
        // TODO add your handling code here:

                Int a,b=5;
                a=Integer.parseInt(txtbilangan.getText());
                while(b>=1) {
                                areahasil.append(b+""+"\n");
                                b--;
                }                             
}


private void bbatalActionPerformed(java.awt.event.ActionEvent evt) {
        // TODO add your handling code here:

                txtbilangan.setText(" ");
                areahasilsetText(" ");
}

    private void bkeluarActionPerformed(java.awt.event.ActionEvent evt) {
        // TODO add your handling code here:

dispose ();
}


 MODUL 8.3
MENGGUNAKAN PERINTAH PERULANGAN WHILE 

private void bprosesActionPerformed(java.awt.event.ActionEvent evt) {
        // TODO add your handling code here:

                Int a,b=9;
                a=Integer.parseInt(txtbilangan.getText());
                while(b>=0) {
                                areahasil.append(b+""+"\n");
                                b-=3;
                }                             
}


private void bbatalActionPerformed(java.awt.event.ActionEvent evt) {
        // TODO add your handling code here:

txtbilangan.setText(" ");
                areahasilsetText(" ");
}

    private void bkeluarActionPerformed(java.awt.event.ActionEvent evt) {
        // TODO add your handling code here:

dispose ();
}

 MODUL 8.4
MENGGUNAKAN PERINTAH PERULANGAN WHILE

private void bprosesActionPerformed(java.awt.event.ActionEvent evt) {
        // TODO add your handling code here:

                Int a,b=1;
                a=Integer.parseInt(txtbilangan.getText());
                while(b<=3) {
                                areahasil.append(b+""+"\n");
                                areahasil.append(b+""+"\n");
                                areahasil.append(b+""+"\n");
                                b++;
                }                             
}


private void bbatalActionPerformed(java.awt.event.ActionEvent evt) {
        // TODO add your handling code here:

                txtbilangan.setText(" ");
                areahasilsetText(" ");

}

    private void bkeluarActionPerformed(java.awt.event.ActionEvent evt) {
        // TODO add your handling code here:

dispose ();
}

MODUL 9.1
MENGGUNAKAN PERINTAH PERULANGAN DO-WHILE 


private void bprosesActionPerformed(java.awt.event.ActionEvent evt) {
        // TODO add your handling code here:

                Int a,b=10;
                a=Integer.parseInt(txtbilangan.getText());
                do{
                                areahasil.append(b+". KHARISMA+"\n");
                                b+=10;
                }
                                while(b<=50);   
}


private void bbatalActionPerformed(java.awt.event.ActionEvent evt) {
        // TODO add your handling code here:

                txtbilangan.setText(" ");
                areahasilsetText(" ");


}

    private void bkeluarActionPerformed(java.awt.event.ActionEvent evt) {
        // TODO add your handling code here:

dispose ();
}



MODUL 9.2
MENGGUNAKAN PERINTAH PERULANGAN DO-WHILE

private void bprosesActionPerformed(java.awt.event.ActionEvent evt) {
        // TODO add your handling code here:

                Int a,b=5;
                a=Integer.parseInt(txtbilangan.getText());
                do{
                                areahasil.append(b+""+"\n");
                                b--10;
                }
                                while(b>=1);     
}


private void bbatalActionPerformed(java.awt.event.ActionEvent evt) {
        // TODO add your handling code here:

                txtbilangan.setText(" ");
                areahasilsetText(" ");

}

    private void bkeluarActionPerformed(java.awt.event.ActionEvent evt) {
        // TODO add your handling code here:

dispose ();
}
MODUL 9.3
MENGGUNAKAN PERINTAH PERULANGAN DO-WHILE 

private void bprosesActionPerformed(java.awt.event.ActionEvent evt) {
        // TODO add your handling code here:

                Int a,b=9;
                a=Integer.parseInt(txtbilangan.getText());
                do{
                                areahasil.append(b+""+"\n");
                                b-=3;
                }
                                while(b>=0);     
}


private void bbatalActionPerformed(java.awt.event.ActionEvent evt) {
        // TODO add your handling code here:

                txtbilangan.setText(" ");
                areahasilsetText(" ");

}

    private void bkeluarActionPerformed(java.awt.event.ActionEvent evt) {
        // TODO add your handling code here:

dispose ();
}

MODUL 9.4
MENGGUNAKAN PERINTAH PERULANGAN DO-WHILE 

private void bprosesActionPerformed(java.awt.event.ActionEvent evt) {
        // TODO add your handling code here:


                Int a,b=1;
                a=Integer.parseInt(txtbilangan.getText());
                do{
                                areahasil.append(b+""+"\n");
                                areahasil.append(b+""+"\n");
                                areahasil.append(b+""+"\n");
                                b++;
                }
                                while(b<=3);     
}


private void bbatalActionPerformed(java.awt.event.ActionEvent evt) {
        // TODO add your handling code here:

                txtbilangan.setText(" ");
                areahasilsetText(" ");

}

    private void bkeluarActionPerformed(java.awt.event.ActionEvent evt) {
        // TODO add your handling code here:

dispose ();
}

1 komentar:

  1. Live Dealer Games at Casino Kekarnews - Kekarnews
    Discover the 예스 벳 best 바카라 게임 live casino games at Casino Kekarnews. 바카라사이트 Play live dealer 토토 사이트 games with the same casino card. 바카라 사이트

    BalasHapus