Tuliskan Listing berikut dibawah "Package"
import javax.swing.JOptionPane;
public class FormJualMobil extends javax.swing.JFrame {
private int hrg, ttl, ac, central, kaca;
private String merk;
public FormJualMobil() {
initComponents();
setLocationRelativeTo(this);
}
private void bkeluarActionPerformed(java.awt.event.ActionEvent evt) {
System.exit(0);
}
private void bbersihActionPerformed(java.awt.event.ActionEvent evt) {
cbkode.setSelectedItem("-PILIH-");
tmerk.setText("");
tharga.setText("");
tac.setText("");
tcentral.setText("");
tkaca.setText("");
ttotal.setText("");
cac.setSelected(false);
ccentral.setSelected(false);
ckaca.setSelected(false);
}
private void cbkodeActionPerformed(java.awt.event.ActionEvent evt) {
if (cbkode.getSelectedItem().equals("MAV01"))
{ merk="AVANZA";
hrg=125000000;}
else if (cbkode.getSelectedItem().equals("MXE02"))
{ merk="XENIA";
hrg=115000000;}
else if (cbkode.getSelectedItem().equals("MIN03"))
{ merk="INOVA";
hrg=135000000;}
tmerk.setText(merk);
tharga.setText(String.valueOf(hrg));
total();
ttotal.setText(String.valueOf(ttl));
}
private void cacActionPerformed(java.awt.event.ActionEvent evt) {
if (cac.isSelected()==true )
{ ac=20000; }
else {ac=0;}
tac.setText(String.valueOf(ac));
total();
ttotal.setText(String.valueOf(ttl));
}
private void ccentralActionPerformed(java.awt.event.ActionEvent evt) {
if (ccentral.isSelected()==true )
{ central=10000; }
else {central=0;}
tcentral.setText(String.valueOf(central));
total();
ttotal.setText(String.valueOf(ttl));
}
private void ckacaActionPerformed(java.awt.event.ActionEvent evt) {
if (ckaca.isSelected()==true )
{ kaca=20000; }
else {kaca=0;}
tkaca.setText(String.valueOf(kaca));
total();
ttotal.setText(String.valueOf(ttl));
}
void total()
{ ttl=hrg+ac+kaca+central; }