Jawaban :
/*
* 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.
*/
package Menu;
/**
* 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")
// <editor-fold defaultstate="collapsed" desc="Generated Code">
private void initComponents() {
jLabel3.setText("Harga :");
jLabel4.setText("Jumlah :");
jLabel5.setText("Menu Minuman");
jLabel6.setText("Harga :");
jLabel7.setText("Jumlah :");
setText berfungsi untuk menampilkan teks yang diambil kedalam teks area dibawahnya.
cbxnasipadang.setText("Nasi Padang");
cbxnasigoreng.setText("Nasi Goreng");
cbxnasikuning.setText("Nasi Kuning");
cbxnasikebuli.setText("Nasi Kebuli");
cbxnasikelapa.setText("Nasi Kelapa");
jLabel8.setText("Rp. 15.000");
jLabel9.setText("Rp. 15.000");
jLabel10.setText("Rp. 15.000");
jLabel11.setText("Rp. 15.000");
jLabel12.setText("Rp. 15.000");
cbxtehanget.setText("Teh Anget");
cbxesjeruk.setText("Es Jeruk");
cbxestehmanis.setText("Es Teh");
cbxjerukanget.setText("Jeruk Anget");
jLabel13.setText("Rp. 5.000");
jLabel14.setText("Rp. 5.000");
jLabel15.setText("Rp. 5.000");
jLabel16.setText("Rp. 5.000");
txapesan.setColumns(20);
=> txapesan.setColumns berfungsi untuk menampilkan banyak colum yang dihasilkan pada aplikasi.
txapesan.setRows(5);
txapesan.setRows berfungsi untuk menampilkan banyakya baris pada menu yang dipesan.
jScrollPane1.setViewportView(txapesan);
btnpesan.setText("Pesan");
btnpesan.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnpesanActionPerformed(evt);
}
});
Actionperformed dan actonlistener berfungsi sebagai method yang digunakan ketika event
action terjadi.
btnreset.setText("Reset");
Metode diatas digunkan untuk menampilkan harga-harga pesanan yang dipesan pada aplikasi.
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* 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(MenuMakanan.class.getName()).log(java.util.logging.Level.SEVERE,
null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(MenuMakanan.class.getName()).log(java.util.logging.Level.SEVERE,
null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(MenuMakanan.class.getName()).log(java.util.logging.Level.SEVERE,
null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(MenuMakanan.class.getName()).log(java.util.logging.Level.SEVERE,
null, ex);
}
//</editor-fold>