Aplikasi Penjualan Ice Cream
soure code untuk rasa ice cream dan topping
private void RBStrawberryActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
TextRasaIceCream.setText(""+RBStrawberry.getText());
TextHarga.setText(""+55000);
}
private void RBCokelatActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
TextRasaIceCream.setText(""+RBCokelat.getText());
TextHarga.setText(""+50000);
}
private void RBVanilaActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
TextRasaIceCream.setText(""+RBVanila.getText());
TextHarga.setText(""+45000);
}
private void RBMatchaActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
TextRasaIceCream.setText(""+RBMatcha.getText());
TextHarga.setText(""+60000);
}
// TODO add your handling code here:
TextRasaIceCream.setText(""+RBStrawberry.getText());
TextHarga.setText(""+55000);
}
private void RBCokelatActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
TextRasaIceCream.setText(""+RBCokelat.getText());
TextHarga.setText(""+50000);
}
private void RBVanilaActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
TextRasaIceCream.setText(""+RBVanila.getText());
TextHarga.setText(""+45000);
}
private void RBMatchaActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
TextRasaIceCream.setText(""+RBMatcha.getText());
TextHarga.setText(""+60000);
}
private void RBKokoCrunchActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
TextTopping.setText(""+RBKokoCrunch.getText());
TextHarga2.setText(""+10000);
}
private void RBOreoActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
TextTopping.setText(""+RBOreo.getText());
TextHarga2.setText(""+10000);
}
// TODO add your handling code here:
TextTopping.setText(""+RBKokoCrunch.getText());
TextHarga2.setText(""+10000);
}
private void RBOreoActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
TextTopping.setText(""+RBOreo.getText());
TextHarga2.setText(""+10000);
}
source code untuk check box diskon
private void CBDiskonActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
if(CBDiskon.isSelected()){
int harga=Integer.parseInt(TextHarga.getText());
int Diskon=harga/10;
TextDiskon.setText(""+Diskon);
}else{
TextDiskon.setText(""+0);
}
}
// TODO add your handling code here:
if(CBDiskon.isSelected()){
int harga=Integer.parseInt(TextHarga.getText());
int Diskon=harga/10;
TextDiskon.setText(""+Diskon);
}else{
TextDiskon.setText(""+0);
}
}
source code untuk total harga
private void TotalHargaActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
int bil1=Integer.parseInt(TextHarga.getText());
int bil2=Integer.parseInt(TextHarga2.getText());
int bil3=Integer.parseInt(TextDiskon.getText());
int hasil=bil1+bil2-bil3;
TextTotalHarga.setText(""+hasil);
}
// TODO add your handling code here:
int bil1=Integer.parseInt(TextHarga.getText());
int bil2=Integer.parseInt(TextHarga2.getText());
int bil3=Integer.parseInt(TextDiskon.getText());
int hasil=bil1+bil2-bil3;
TextTotalHarga.setText(""+hasil);
}
Tidak ada komentar:
Posting Komentar