tomcat hosting
B8/UzJQnikPDgI/AAAAAAAAAB4/jC2TQ8B4pAo/s1600/logo.jpg" />
CARA MEMBUAT FRAME DAN PANEL NILAI
DI NETBEANS
1. Buat projek baru di netbeans
2. Pilih menu GUI pada netbeans
3. Pilih jFrame atau applet
4. Tambahkan 4 buah Label, 1 buah TextField dan Sebuah Button
5. Click kanan pada Button -> Events -> ActionPerformed
5. Kemudian Tulis scrip nya seperti di bawah ini:
___________________________________________________________________________________
---------------------------------------------------------------------------------------------------------------
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
int nilai;
String nilaihuruf,keterangan;
nilai=Integer.parseInt(jTextField1.getText());
if(nilai>=101){
jLabel2.setText("XXX");
jLabel3.setText("XXX");
}
else if(nilai>=91){
jLabel2.setText("A");
jLabel3.setText("nilai istimewa");
}
else if(nilai>=76){
jLabel2.setText("B");
jLabel3.setText("nilai Bagus");
}
else if(nilai>=61){
jLabel2.setText("C");
jLabel3.setText("nilai Cukup");
}
else if(nilai>=0){
jLabel2.setText("D");
jLabel3.setText("nilai Kurang");
}
// TODO add your handling code here:
}
private void jTextField1ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
}
// Variables declaration - do not modify
private javax.swing.JButton jButton1;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel jLabel4;
private javax.swing.JTextField jTextField1;
// End of variables declaration
}
_________________________________________________________________________________
------------------------------------------------------------------------------------------------------------
0 komentar:
Posting Komentar