Tak Berkategori

Aplikasi kasir steam motor sederhana berbasis JAVA GUI

Assalamualikum wr, wb.

Selamat datang (^0^)/

Pada postingan kali ini, saya akan membuat aplikasi kasir sederhana untuk steam motor yang berbasis JAVA GUI menggunakan JFrame.

Berikut hasil dari run aplikasinya.gui2.JPG

Pada aplikasi tersebut, saya menggunakan beberapa komponen Jframe seperti :

  1. Label
  2. Textfield
  3. radiobutton
  4. checkbox
  5. combobox
  6. joptionpane
  7. textarea
  8. button

Berikut penjelasan alur programnya.

  1. Mula-mula, user akan dihadirkan dengan pop up selamat datang. seperti dibawah ini.gui1.JPG
  2. Dan kemudian akan langsung menuju menu utama seperti pada gambar pertama tadi.
  3. Kemudian user diharuskan menginput nama, dan memilih model kendaraan user yang akan berpengaruh pada tarif harga steam, dan juga  jenis kendaraan user. seperti dibawah ini.gui3.JPG
  4. Kemudian dengan radio button, user bisa memilih metode pembayaran yang saya buat menggunakan radiobutton. Dan juga user bisa memilih servis tambahan selain steam yang saya buat dengan checkbox. seperti dibawah ini.gui4.JPG
  5. Kemudian dengan tombol “hitung” akan menghitung total transaksi.
  6. Dan dengan “cetak nota” maka akan mengisi textfield dan textarea yang bersangkutan. seperti dibawah ini.gui5.JPG
  7. Ketika selesai, maka user harus menekan tombol ‘EXIT” dan akan keluar dari aplikasi tersebut. seperti dibawah ini.gui6

Begitulah penjelasan program yang sudah saya buat. Dibawah ini saya akan cantumkan source code nya.

SOURCE CODE:


/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/

/**
*
* @author Sempak_Ranger
*/
import javax.swing.JOptionPane;
public class akhsansteam extends javax.swing.JFrame {

/**
* Creates new form akhsansteam
*/
public akhsansteam() {
initComponents();
JOptionPane.showMessageDialog(null, “Selamat Datang di AKHSAN STEAM”, “Welcome”, JOptionPane.INFORMATION_MESSAGE);
}

/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings(“unchecked”)
//
private void initComponents() {

metode = new javax.swing.ButtonGroup();
jPanel1 = new javax.swing.JPanel();
jLabel1 = new javax.swing.JLabel();
jPanel2 = new javax.swing.JPanel();
jLabel2 = new javax.swing.JLabel();
cboKode = new javax.swing.JComboBox<>();
jLabel3 = new javax.swing.JLabel();
tfMerk = new javax.swing.JTextField();
jLabel4 = new javax.swing.JLabel();
tfNama = new javax.swing.JTextField();
jLabel5 = new javax.swing.JLabel();
cboKaca = new javax.swing.JCheckBox();
cboBody = new javax.swing.JCheckBox();
cboMesin = new javax.swing.JCheckBox();
tfKaca = new javax.swing.JTextField();
tfBody = new javax.swing.JTextField();
tfMesin = new javax.swing.JTextField();
jLabel6 = new javax.swing.JLabel();
tfSteam = new javax.swing.JTextField();
jLabel7 = new javax.swing.JLabel();
tfTotal = new javax.swing.JTextField();
rbKredit = new javax.swing.JRadioButton();
rbCash = new javax.swing.JRadioButton();
tfDiskon = new javax.swing.JTextField();
bHitung = new javax.swing.JButton();
jPanel3 = new javax.swing.JPanel();
bCetak = new javax.swing.JButton();
tfServisKaca = new javax.swing.JTextField();
jScrollPane1 = new javax.swing.JScrollPane();
taNota = new javax.swing.JTextArea();
tfMetode = new javax.swing.JTextField();
tfServisBody = new javax.swing.JTextField();
tfServisMesin = new javax.swing.JTextField();
bExit = new javax.swing.JButton();

setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
addWindowListener(new java.awt.event.WindowAdapter() {
public void windowActivated(java.awt.event.WindowEvent evt) {
formWindowActivated(evt);
}
});

jPanel1.setBackground(new java.awt.Color(51, 255, 51));

jLabel1.setFont(new java.awt.Font(“Impact”, 1, 18)); // NOI18N
jLabel1.setForeground(new java.awt.Color(255, 0, 51));
jLabel1.setText(“=== AKHSAN STEAM ===”);

javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel1)
.addGap(254, 254, 254))
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(16, 16, 16)
.addComponent(jLabel1)
.addContainerGap(22, Short.MAX_VALUE))
);

jPanel2.setBackground(new java.awt.Color(157, 123, 93));
jPanel2.setForeground(new java.awt.Color(187, 146, 102));

jLabel2.setFont(new java.awt.Font(“Dialog”, 1, 14)); // NOI18N
jLabel2.setForeground(new java.awt.Color(0, 0, 0));
jLabel2.setText(“Kode Mobil :”);

cboKode.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
cboKodeActionPerformed(evt);
}
});

jLabel3.setFont(new java.awt.Font(“Dialog”, 1, 14)); // NOI18N
jLabel3.setForeground(new java.awt.Color(0, 0, 0));
jLabel3.setText(“Merk Mobil :”);

jLabel4.setFont(new java.awt.Font(“Dialog”, 1, 14)); // NOI18N
jLabel4.setForeground(new java.awt.Color(0, 0, 0));
jLabel4.setText(“Nama Pemilik :”);

jLabel5.setFont(new java.awt.Font(“Dialog”, 1, 14)); // NOI18N
jLabel5.setForeground(new java.awt.Color(0, 0, 0));
jLabel5.setText(“Servis :”);

cboKaca.setText(“Poles Kaca”);
cboKaca.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
cboKacaActionPerformed(evt);
}
});

cboBody.setText(“Poles Body”);
cboBody.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
cboBodyActionPerformed(evt);
}
});

cboMesin.setText(“Poles Mesin”);
cboMesin.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
cboMesinActionPerformed(evt);
}
});

tfKaca.setText(“0”);

tfBody.setText(“0”);

tfMesin.setText(“0”);

jLabel6.setFont(new java.awt.Font(“Dialog”, 1, 14)); // NOI18N
jLabel6.setForeground(new java.awt.Color(0, 0, 0));
jLabel6.setText(“Harga Steam”);

tfSteam.setText(“0”);

jLabel7.setFont(new java.awt.Font(“Dialog”, 1, 14)); // NOI18N
jLabel7.setForeground(new java.awt.Color(0, 0, 0));
jLabel7.setText(“Total Bayar”);

tfTotal.setText(“0”);

metode.add(rbKredit);
rbKredit.setText(“CC/DC”);

metode.add(rbCash);
rbCash.setText(“CASH”);
rbCash.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
rbCashActionPerformed(evt);
}
});

tfDiskon.setText(“0”);

bHitung.setText(“Hitung”);
bHitung.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
bHitungActionPerformed(evt);
}
});

javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
jPanel2.setLayout(jPanel2Layout);
jPanel2Layout.setHorizontalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addGroup(jPanel2Layout.createSequentialGroup()
.addComponent(jLabel4)
.addGap(18, 18, 18)
.addComponent(tfNama))
.addGroup(jPanel2Layout.createSequentialGroup()
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel2)
.addComponent(jLabel3))
.addGap(30, 30, 30)
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(cboKode, javax.swing.GroupLayout.PREFERRED_SIZE, 140, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(tfMerk, javax.swing.GroupLayout.PREFERRED_SIZE, 139, javax.swing.GroupLayout.PREFERRED_SIZE))))
.addComponent(jLabel5)
.addGroup(jPanel2Layout.createSequentialGroup()
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(cboMesin)
.addComponent(cboBody)
.addComponent(cboKaca)
.addComponent(jLabel6)
.addComponent(jLabel7))
.addGap(18, 18, 18)
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addComponent(tfTotal, javax.swing.GroupLayout.PREFERRED_SIZE, 143, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(bHitung))
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(tfMesin, javax.swing.GroupLayout.DEFAULT_SIZE, 143, Short.MAX_VALUE)
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
.addComponent(tfKaca, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 142, Short.MAX_VALUE)
.addComponent(tfBody, javax.swing.GroupLayout.Alignment.LEADING))
.addComponent(tfSteam))))
.addGroup(jPanel2Layout.createSequentialGroup()
.addComponent(rbKredit)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(rbCash)
.addGap(18, 18, 18)
.addComponent(tfDiskon, javax.swing.GroupLayout.PREFERRED_SIZE, 96, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addContainerGap(27, Short.MAX_VALUE))
);
jPanel2Layout.setVerticalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addGap(21, 21, 21)
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel4)
.addComponent(tfNama, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(cboKode, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel2))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel3)
.addComponent(tfMerk, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(rbKredit)
.addComponent(rbCash)
.addComponent(tfDiskon, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel5)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(cboKaca)
.addComponent(tfKaca, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(cboBody)
.addComponent(tfBody, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(cboMesin)
.addComponent(tfMesin, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel6)
.addComponent(tfSteam, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel7)
.addComponent(tfTotal, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(bHitung))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);

jPanel3.setBackground(new java.awt.Color(157, 123, 93));
jPanel3.setForeground(new java.awt.Color(187, 146, 102));

bCetak.setText(“Cetak Nota”);
bCetak.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
bCetakActionPerformed(evt);
}
});

taNota.setColumns(20);
taNota.setRows(5);
jScrollPane1.setViewportView(taNota);

tfMetode.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
tfMetodeActionPerformed(evt);
}
});

bExit.setText(“EXIT”);
bExit.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
bExitActionPerformed(evt);
}
});

javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
jPanel3.setLayout(jPanel3Layout);
jPanel3Layout.setHorizontalGroup(
jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel3Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(tfServisKaca)
.addGroup(jPanel3Layout.createSequentialGroup()
.addComponent(bCetak)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(bExit))
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 318, Short.MAX_VALUE)
.addComponent(tfMetode)
.addComponent(tfServisBody)
.addComponent(tfServisMesin))
.addContainerGap())
);
jPanel3Layout.setVerticalGroup(
jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel3Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(bCetak)
.addComponent(bExit))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(tfMetode, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(tfServisKaca, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(tfServisBody, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(tfServisMesin, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 222, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap())
);

javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(12, 12, 12)
.addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addContainerGap())
);

pack();
}//

private void formWindowActivated(java.awt.event.WindowEvent evt) {
// TODO add your handling code here:
cboKode.addItem(“-“);
cboKode.addItem(“SUV”);
cboKode.addItem(“SEDAN”);
cboKode.addItem(“SPORT”);
}

private void cboKodeActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
if (cboKode.getSelectedItem().equals(“SUV”)){
tfSteam.setText(“35000”);
}
if (cboKode.getSelectedItem().equals(“SEDAN”)){
tfSteam.setText(“30000”);
}
if (cboKode.getSelectedItem().equals(“SPORT”)){
tfSteam.setText(“50000”);
}
}

private void rbCashActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
if (rbCash.isSelected()){
int a=Integer.parseInt(tfSteam.getText());
int diskon=a/5;
tfDiskon.setText(“”+diskon);
}
}

private void cboKacaActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
if (cboKaca.isSelected()){
tfKaca.setText(“15000”);
}
}

private void cboBodyActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
if (cboBody.isSelected()){
tfBody.setText(“25000”);
}
}

private void cboMesinActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
if (cboMesin.isSelected()){
tfMesin.setText(“20000”);
}
}

private void bHitungActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
int a=Integer.parseInt(tfDiskon.getText());
int b=Integer.parseInt(tfKaca.getText());
int c=Integer.parseInt(tfBody.getText());
int d=Integer.parseInt(tfMesin.getText());
int e=Integer.parseInt(tfSteam.getText());

int total=a+b+c+d+e;
tfTotal.setText(“”+total);

}

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

if (rbCash.isSelected()){
tfMetode.setText(“Pembayaran : Cash”);
}else{
tfMetode.setText(“Pembayaran : CC/CD”);
}

if (cboKaca.isSelected()){
tfServisKaca.setText(“Poles Kaca Mobil : 15.000”);
}
if (cboBody.isSelected()){
tfServisBody.setText(“Poles Body Mobil : 25.000”);
}
if (cboMesin.isSelected()){
tfServisMesin.setText(“Poles Mesin Mobil : 20.000”);
}

String a=(String) tfNama.getText();
String b=(String) cboKode.getSelectedItem();
String c=(String) tfMerk.getText();
String d=(String) tfDiskon.getText();
String e=(String) tfTotal.getText();
taNota.setText(“Nama Pelanggan\t: “+a
+”\nModel Mobil\t\t: “+b
+”\nMerk Mobil\t\t: “+c
+”\nDiskon sebesar\t: “+d
+”\nTotal Transaksi sebesar\t: “+e
);
}

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

private void bExitActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
if (JOptionPane.showConfirmDialog(null, “Apakah transaksi anda sudah selesai?”,”EXIT”,JOptionPane.YES_NO_OPTION)==JOptionPane.YES_OPTION){
System.exit(0);
}
}

/**
* @param args the command line arguments
/
public static void main(String args[]) {
/
Set the Nimbus look and feel /
//
/
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(akhsansteam.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(akhsansteam.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(akhsansteam.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(akhsansteam.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}
//

/* Create and display the form */
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new akhsansteam().setVisible(true);
}
});
}

// Variables declaration – do not modify
private javax.swing.JButton bCetak;
private javax.swing.JButton bExit;
private javax.swing.JButton bHitung;
private javax.swing.JCheckBox cboBody;
private javax.swing.JCheckBox cboKaca;
private javax.swing.JComboBox cboKode;
private javax.swing.JCheckBox cboMesin;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel jLabel4;
private javax.swing.JLabel jLabel5;
private javax.swing.JLabel jLabel6;
private javax.swing.JLabel jLabel7;
private javax.swing.JPanel jPanel1;
private javax.swing.JPanel jPanel2;
private javax.swing.JPanel jPanel3;
private javax.swing.JScrollPane jScrollPane1;
private javax.swing.ButtonGroup metode;
private javax.swing.JRadioButton rbCash;
private javax.swing.JRadioButton rbKredit;
private javax.swing.JTextArea taNota;
private javax.swing.JTextField tfBody;
private javax.swing.JTextField tfDiskon;
private javax.swing.JTextField tfKaca;
private javax.swing.JTextField tfMerk;
private javax.swing.JTextField tfMesin;
private javax.swing.JTextField tfMetode;
private javax.swing.JTextField tfNama;
private javax.swing.JTextField tfServisBody;
private javax.swing.JTextField tfServisKaca;
private javax.swing.JTextField tfServisMesin;
private javax.swing.JTextField tfSteam;
private javax.swing.JTextField tfTotal;
// End of variables declaration
}

Terima kasih atas perhatian dan dukungannya, mohon maaf bila masih ada yang kurang dari program yang sudah saya buat ini. Sekian dari saya.

 

Terima kasih,

Wassalamualaikum wr, wb.