Tes
Tes
ActionEvent evt) {
nama = (txtnamalengkap.getText());
nim = Double.parseDouble(txtnim.getText());
hadir = Double.parseDouble(txthadir.getText());
tugas = Double.parseDouble(txttugas.getText());
uts = Double.parseDouble(txtuts.getText());
uas = Double.parseDouble(txtuas.getText());
nilai = (hadir/14*14)+(tugas*20/100)+(uts*30/100)+(uas*40/100);
hasil=String.valueOf(nilai);
nim2=String.valueOf(nim);
if(nilai>=85){
lblgrade.setText("A");
lblhasil.setText("ANDA LULUS");
}
else if ((nilai<84)&&(nilai>=70)){
lblgrade.setText("B");
lblhasil.setText("ANDA LULUS");
}
else if ((nilai<70)&&(nilai>=55)){
lblgrade.setText("C");
lblhasil.setText("ANDA HARUS REMIDIAL");
}
else if ((nilai<55)&&(nilai>=40)){
lblgrade.setText("D");
lblhasil.setText("ANDA HARUS REMIDIAL");
}
else if ((nilai<40)&&(nilai>=0)){
lblgrade.setText("E");
lblhasil.setText("SELAMAT ANDA TIDAK LULUS");
}
nim1.setText("NIM : ");
nm.setText("Nama : ");
rt.setText("Nilai rata-rata :");
grd.setText("Grade : ");
hsl.setText("Hasilnya : ");
lblnama.setText(nama);
hasilnim.setText(nim2);
lblrata.setText(hasil);
lblgrade.getText();
lblhasil.getText();
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code
(optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the
default look and feel.
* For details see
http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/
try {
for (javax.swing.UIManager.LookAndFeelInfo info :
javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException ex) {
java.util.logging.Logger.getLogger(formnilai.class.getName()).log(java.util.logging
.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(formnilai.class.getName()).log(java.util.logging
.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(formnilai.class.getName()).log(java.util.logging
.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(formnilai.class.getName()).log(java.util.logging
.Level.SEVERE, null, ex);
}
//</editor-fold>