Pemrograman Desktop Dengan Java GUI
Pemrograman Desktop
Preview Program
Source code peogram
Main.java
public static void main(String[] args) {
// TODO code application logic here
new fMBaru().setVisible(true);
Tambahan pada fMBaru
public class fMBaru extends javax.swing.JFrame {
/** Creates new form fMBaru */
int spptetap = 950000;
int sppvar;
int sumbangan;
public fMBaru() {
initComponents();
rdgSum.add(rdo1);
rdgSum.add(rdo2);
rdgSum.add(rdo3);
rdgJur.add(rdoTI);
rdgJur.add(rdoSI);
rdgJur.add(rdoMI);
rdgJur.add(rdoTK);
rdgJur.add(rdoKA);
}
Source btb Hitung
private void btnHitungMouseClicked(java.awt.event.MouseEvent evt) {
// TODO add your handling code here:
double angs1, angs2, angs3, angs4;
double jumlah;
txtNo1.setText(txtNo.getText());
txtNama1.setText(txtNama.getText());
if(rdo1.isSelected())
sumbangan = 8100000;
if(rdo2.isSelected())
sumbangan = 8500000;
if(rdo3.isSelected())
sumbangan = 8900000;
if(rdoTI.isSelected())
sppvar = 1000000;
if(rdoSI.isSelected())
sppvar = 1000000;
if(rdoMI.isSelected())
sppvar = 1150000;
if(rdoTK.isSelected())
sppvar = 1200000;
if(rdoKA.isSelected())
sppvar = 1250000;
angs1 = spptetap + (0.3*sumbangan);
angs2 = sppvar + (0.3*sumbangan);
angs3 = spptetap + (0.3*sumbangan);
angs4 = 0.1*sumbangan;
txtAng1.setText(""+angs1);
txtAng2.setText(""+angs2);
txtAng3.setText(""+angs3);
txtAng4.setText(""+angs4);
}
Source btnKeluar
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
System.exit(0);
}
Hasil Kompilasi
Comments
Post a Comment
Please Don't make SPAM HERE !