Jumat, 03 April 2015

TUGAS PRAKTIKUM PEMROGRAMAN VISUAL MODUL 4

Diposting oleh yuli yanti di 22.46



TUGAS PRAKTIKUM PEMROGRAMAN VISUAL
MODUL 4

soal : Buatlah Sebuah form seperti gambar dibawah ini..
ketentuan : Jika tombol proses di tekan/di klik maka apabila nilai lebih besar atau sama dengan 60 , Maka Keterangan disisi dengan “LULUS” selain itu “Mengulang”





JAWAB :
  1. Tampilan Design awal :



  1. Kode Program untuk button PROSES:

private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
int a;
a = Integer.parseInt(enilai.getText());
if (a >= 60){
eket.setText("LULUS");
}else{
eket.setText("MENGULANG");
}
}

  1. Kode Program untuk Button BATAL :

private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
enim.setText("");
enama.setText("");
enilai.setText("");
eket.setText("");
}

  1. Kode Program untuk Button KELUAR :

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


  1. pilih run > run file
Hasil Tampilan akhir : 















#terimakasih




0 komentar:

Posting Komentar

 

next level Copyright © 2010 Design by Ipietoon Blogger Template Graphic from Enakei