Aplikasi Restoran Online
1. Deskripsi
Aplikasi Resto Online ini sangat berguna disaat lapar datang tiba dan membutuhkan makanan yang cepat tanpa harus keluar rumah untuk membelinya, dengan adanya aplikasi ini semua jadi mudah untuk memesan makanan tinggal diam dirumah saja makanan akan tiba.
2.SreenShoot Desain Frame
3.ScreenShoot Run
4. Source Code
- Code Form 1
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/*
* MakananResto.java
*
* Created on Jan 13, 2019, 4:03:15 PM
*/
package restoranonline;
import java.awt.HeadlessException;
import javax.swing.table.DefaultTableModel;
import java.sql.*;
import javax.swing.*;
import javax.swing.table.*;
/**
*
* @author dell
*/
public class MenuResto extends javax.swing.JFrame {
/** Creates new form MakananResto */
public MenuResto() {
initComponents();
}
/** 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() {
ayam = new javax.swing.JButton();
menu = new javax.swing.JButton();
udang = new javax.swing.JButton();
nasigoreng = new javax.swing.JButton();
sayur = new javax.swing.JButton();
kangkung = new javax.swing.JButton();
jButton1 = new javax.swing.JButton();
jLabel1 = new javax.swing.JLabel();
jLabel2 = new javax.swing.JLabel();
jLabel3 = new javax.swing.JLabel();
jLabel4 = new javax.swing.JLabel();
jLabel5 = new javax.swing.JLabel();
jLabel6 = new javax.swing.JLabel();
jLabel7 = new javax.swing.JLabel();
ikan = new javax.swing.JButton();
jLabel8 = new javax.swing.JLabel();
jLabel9 = new javax.swing.JLabel();
jLabel10 = new javax.swing.JLabel();
jLabel11 = new javax.swing.JLabel();
jLabel12 = new javax.swing.JLabel();
jLabel13 = new javax.swing.JLabel();
nasiputih = new javax.swing.JButton();
jLabel14 = new javax.swing.JLabel();
jLabel15 = new javax.swing.JLabel();
esjeruk = new javax.swing.JButton();
esteh = new javax.swing.JButton();
eskelapa = new javax.swing.JButton();
jLabel16 = new javax.swing.JLabel();
kopi = new javax.swing.JButton();
selanjutnya = new javax.swing.JButton();
jLabel20 = new javax.swing.JLabel();
jLabel21 = new javax.swing.JLabel();
jLabel22 = new javax.swing.JLabel();
jLabel23 = new javax.swing.JLabel();
jLabel24 = new javax.swing.JLabel();
jLabel25 = new javax.swing.JLabel();
jLabel26 = new javax.swing.JLabel();
jLabel27 = new javax.swing.JLabel();
harga1 = new javax.swing.JTextField();
nama1 = new javax.swing.JTextField();
jml1 = new javax.swing.JTextField();
total1 = new javax.swing.JTextField();
proses = new javax.swing.JButton();
totalbiaya = new javax.swing.JTextField();
harga2 = new javax.swing.JTextField();
nama2 = new javax.swing.JTextField();
jml2 = new javax.swing.JTextField();
total2 = new javax.swing.JTextField();
harga3 = new javax.swing.JTextField();
nama3 = new javax.swing.JTextField();
jml3 = new javax.swing.JTextField();
total3 = new javax.swing.JTextField();
harga4 = new javax.swing.JTextField();
nama4 = new javax.swing.JTextField();
jml4 = new javax.swing.JTextField();
total4 = new javax.swing.JTextField();
jLabel17 = new javax.swing.JLabel();
jLabel18 = new javax.swing.JLabel();
jLabel19 = new javax.swing.JLabel();
jLabel28 = new javax.swing.JLabel();
jLabel29 = new javax.swing.JLabel();
jLabel30 = new javax.swing.JLabel();
jLabel31 = new javax.swing.JLabel();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
setTitle(" MENU");
getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());
ayam.setIcon(new javax.swing.ImageIcon("D:\\ayam.jpg")); // NOI18N
ayam.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
ayamActionPerformed(evt);
}
});
getContentPane().add(ayam, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 50, 122, 106));
menu.setBackground(new java.awt.Color(-16776961,true));
menu.setText("Kembali");
menu.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
menuActionPerformed(evt);
}
});
getContentPane().add(menu, new org.netbeans.lib.awtextra.AbsoluteConstraints(220, 490, -1, -1));
udang.setIcon(new javax.swing.ImageIcon("D:\\udang.jpg")); // NOI18N
udang.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
udangActionPerformed(evt);
}
});
getContentPane().add(udang, new org.netbeans.lib.awtextra.AbsoluteConstraints(160, 190, 125, 110));
nasigoreng.setIcon(new javax.swing.ImageIcon("D:\\nasi goreng.jpg")); // NOI18N
nasigoreng.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
nasigorengActionPerformed(evt);
}
});
getContentPane().add(nasigoreng, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 190, 139, 110));
sayur.setIcon(new javax.swing.ImageIcon("D:\\sayur asem.jpg")); // NOI18N
sayur.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
sayurActionPerformed(evt);
}
});
getContentPane().add(sayur, new org.netbeans.lib.awtextra.AbsoluteConstraints(290, 50, 122, 106));
kangkung.setIcon(new javax.swing.ImageIcon("D:\\kangkung.jpg")); // NOI18N
kangkung.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
kangkungActionPerformed(evt);
}
});
getContentPane().add(kangkung, new org.netbeans.lib.awtextra.AbsoluteConstraints(300, 190, 116, 111));
jButton1.setIcon(new javax.swing.ImageIcon("D:\\ikan bakar.jpg")); // NOI18N
getContentPane().add(jButton1, new org.netbeans.lib.awtextra.AbsoluteConstraints(639, 49, 121, 0));
jLabel1.setFont(new java.awt.Font("Dialog", 0, 24)); // NOI18N
jLabel1.setText("DAFTAR MAKANAN");
getContentPane().add(jLabel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(120, 10, -1, -1));
jLabel2.setText("AYAM BAKAR");
getContentPane().add(jLabel2, new org.netbeans.lib.awtextra.AbsoluteConstraints(40, 160, -1, -1));
jLabel3.setText("Rp.15.000");
getContentPane().add(jLabel3, new org.netbeans.lib.awtextra.AbsoluteConstraints(40, 170, -1, -1));
jLabel4.setText("IKAN BAKAR");
getContentPane().add(jLabel4, new org.netbeans.lib.awtextra.AbsoluteConstraints(180, 160, -1, -1));
jLabel5.setText("Rp.10.000");
getContentPane().add(jLabel5, new org.netbeans.lib.awtextra.AbsoluteConstraints(180, 170, -1, -1));
jLabel6.setText("SAYUR ASEM");
getContentPane().add(jLabel6, new org.netbeans.lib.awtextra.AbsoluteConstraints(310, 160, -1, -1));
jLabel7.setText("Rp.10.000");
getContentPane().add(jLabel7, new org.netbeans.lib.awtextra.AbsoluteConstraints(310, 170, -1, -1));
ikan.setIcon(new javax.swing.ImageIcon("D:\\ikan bakar.jpg")); // NOI18N
getContentPane().add(ikan, new org.netbeans.lib.awtextra.AbsoluteConstraints(150, 50, 125, 106));
jLabel8.setText("NASI GORENG");
getContentPane().add(jLabel8, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 300, -1, -1));
jLabel9.setText("UDANG");
getContentPane().add(jLabel9, new org.netbeans.lib.awtextra.AbsoluteConstraints(200, 300, -1, 20));
jLabel10.setText("KANGKUNG");
getContentPane().add(jLabel10, new org.netbeans.lib.awtextra.AbsoluteConstraints(330, 300, -1, -1));
jLabel11.setText("Rp.12.000");
getContentPane().add(jLabel11, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 310, -1, -1));
jLabel12.setText("Rp.20.000");
getContentPane().add(jLabel12, new org.netbeans.lib.awtextra.AbsoluteConstraints(200, 310, -1, 20));
jLabel13.setText("Rp.10.000");
getContentPane().add(jLabel13, new org.netbeans.lib.awtextra.AbsoluteConstraints(330, 310, -1, -1));
nasiputih.setIcon(new javax.swing.ImageIcon("D:\\NASI.jpg")); // NOI18N
nasiputih.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
nasiputihActionPerformed(evt);
}
});
getContentPane().add(nasiputih, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 330, 139, 107));
jLabel14.setText("NASI PUTIH");
getContentPane().add(jLabel14, new org.netbeans.lib.awtextra.AbsoluteConstraints(40, 440, -1, -1));
jLabel15.setText("Rp.5000");
getContentPane().add(jLabel15, new org.netbeans.lib.awtextra.AbsoluteConstraints(40, 450, -1, -1));
esjeruk.setIcon(new javax.swing.ImageIcon("D:\\es jeruk.jpg")); // NOI18N
esjeruk.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
esjerukActionPerformed(evt);
}
});
getContentPane().add(esjeruk, new org.netbeans.lib.awtextra.AbsoluteConstraints(630, 70, 90, 120));
esteh.setIcon(new javax.swing.ImageIcon("D:\\es manis.jpg")); // NOI18N
esteh.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
estehActionPerformed(evt);
}
});
getContentPane().add(esteh, new org.netbeans.lib.awtextra.AbsoluteConstraints(530, 70, 90, 120));
eskelapa.setIcon(new javax.swing.ImageIcon("D:\\es kelapa.jpg")); // NOI18N
getContentPane().add(eskelapa, new org.netbeans.lib.awtextra.AbsoluteConstraints(530, 240, 90, 120));
jLabel16.setFont(new java.awt.Font("Dialog", 0, 24)); // NOI18N
jLabel16.setText("DAFTAR MINUMAN");
getContentPane().add(jLabel16, new org.netbeans.lib.awtextra.AbsoluteConstraints(520, 20, -1, -1));
kopi.setIcon(new javax.swing.ImageIcon("D:\\kopi.jpg")); // NOI18N
getContentPane().add(kopi, new org.netbeans.lib.awtextra.AbsoluteConstraints(630, 240, 90, 120));
selanjutnya.setBackground(new java.awt.Color(-16776961,true));
selanjutnya.setText("SELANJUTNYA");
selanjutnya.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
selanjutnyaActionPerformed(evt);
}
});
getContentPane().add(selanjutnya, new org.netbeans.lib.awtextra.AbsoluteConstraints(310, 490, -1, -1));
jLabel20.setText("ES TEH MANIS");
getContentPane().add(jLabel20, new org.netbeans.lib.awtextra.AbsoluteConstraints(540, 190, -1, -1));
jLabel21.setText("Rp.5000");
getContentPane().add(jLabel21, new org.netbeans.lib.awtextra.AbsoluteConstraints(550, 200, -1, -1));
jLabel22.setText("ES JERUK");
getContentPane().add(jLabel22, new org.netbeans.lib.awtextra.AbsoluteConstraints(650, 190, -1, -1));
jLabel23.setText("Rp.8.000");
getContentPane().add(jLabel23, new org.netbeans.lib.awtextra.AbsoluteConstraints(650, 200, -1, -1));
jLabel24.setText("ES KELAPA");
getContentPane().add(jLabel24, new org.netbeans.lib.awtextra.AbsoluteConstraints(550, 360, -1, -1));
jLabel25.setText("Rp.4000");
getContentPane().add(jLabel25, new org.netbeans.lib.awtextra.AbsoluteConstraints(550, 370, -1, -1));
jLabel26.setText("KOPI");
getContentPane().add(jLabel26, new org.netbeans.lib.awtextra.AbsoluteConstraints(660, 360, -1, -1));
jLabel27.setText("Rp.3000");
getContentPane().add(jLabel27, new org.netbeans.lib.awtextra.AbsoluteConstraints(650, 370, -1, -1));
getContentPane().add(harga1, new org.netbeans.lib.awtextra.AbsoluteConstraints(260, 360, 70, -1));
getContentPane().add(nama1, new org.netbeans.lib.awtextra.AbsoluteConstraints(160, 360, 90, -1));
getContentPane().add(jml1, new org.netbeans.lib.awtextra.AbsoluteConstraints(340, 360, 40, -1));
total1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
total1ActionPerformed(evt);
}
});
getContentPane().add(total1, new org.netbeans.lib.awtextra.AbsoluteConstraints(390, 360, 60, -1));
proses.setBackground(new java.awt.Color(-16776961,true));
proses.setText("proses");
proses.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
prosesActionPerformed(evt);
}
});
getContentPane().add(proses, new org.netbeans.lib.awtextra.AbsoluteConstraints(460, 430, 100, -1));
getContentPane().add(totalbiaya, new org.netbeans.lib.awtextra.AbsoluteConstraints(460, 400, 100, -1));
getContentPane().add(harga2, new org.netbeans.lib.awtextra.AbsoluteConstraints(260, 390, 70, -1));
getContentPane().add(nama2, new org.netbeans.lib.awtextra.AbsoluteConstraints(160, 390, 90, -1));
getContentPane().add(jml2, new org.netbeans.lib.awtextra.AbsoluteConstraints(340, 390, 40, -1));
getContentPane().add(total2, new org.netbeans.lib.awtextra.AbsoluteConstraints(390, 390, 60, -1));
getContentPane().add(harga3, new org.netbeans.lib.awtextra.AbsoluteConstraints(260, 420, 70, -1));
getContentPane().add(nama3, new org.netbeans.lib.awtextra.AbsoluteConstraints(160, 420, 90, -1));
getContentPane().add(jml3, new org.netbeans.lib.awtextra.AbsoluteConstraints(340, 420, 40, -1));
total3.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
total3ActionPerformed(evt);
}
});
getContentPane().add(total3, new org.netbeans.lib.awtextra.AbsoluteConstraints(390, 420, 60, -1));
getContentPane().add(harga4, new org.netbeans.lib.awtextra.AbsoluteConstraints(260, 450, 70, -1));
getContentPane().add(nama4, new org.netbeans.lib.awtextra.AbsoluteConstraints(160, 450, 90, -1));
getContentPane().add(jml4, new org.netbeans.lib.awtextra.AbsoluteConstraints(340, 450, 40, -1));
getContentPane().add(total4, new org.netbeans.lib.awtextra.AbsoluteConstraints(390, 450, 60, -1));
jLabel17.setText("MENU");
getContentPane().add(jLabel17, new org.netbeans.lib.awtextra.AbsoluteConstraints(180, 340, -1, -1));
getContentPane().add(jLabel18, new org.netbeans.lib.awtextra.AbsoluteConstraints(280, 340, -1, -1));
jLabel19.setText("HARGA");
getContentPane().add(jLabel19, new org.netbeans.lib.awtextra.AbsoluteConstraints(270, 340, -1, -1));
jLabel28.setText("JUMLAH");
getContentPane().add(jLabel28, new org.netbeans.lib.awtextra.AbsoluteConstraints(340, 340, -1, -1));
jLabel29.setText("TOTAL");
getContentPane().add(jLabel29, new org.netbeans.lib.awtextra.AbsoluteConstraints(400, 340, -1, -1));
jLabel30.setText("TOTAL Rp.");
getContentPane().add(jLabel30, new org.netbeans.lib.awtextra.AbsoluteConstraints(470, 380, -1, -1));
jLabel31.setBackground(new java.awt.Color(-16776961,true));
jLabel31.setIcon(new javax.swing.ImageIcon("D:\\download (2).jpg")); // NOI18N
jLabel31.setText("jLabel31");
getContentPane().add(jLabel31, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, 770, -1));
pack();
}// </editor-fold>
private void ayamActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
nama1.setText("Ayam Bakar");
harga1.setText("15000");
}
private void menuActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
new RestoranOnline().setVisible(true);
this.setVisible(false);
}
private void sayurActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
nama2.setText("Sayur Asem");
harga2.setText("10000");
}
private void kangkungActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
}
private void nasigorengActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
}
private void udangActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
}
private void esjerukActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
}
private void nasiputihActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
nama3.setText("Nasi");
harga3.setText("5000");
}
private void estehActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
nama4.setText("Es Teh Manis");
harga4.setText("4000");
}
private void prosesActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
int a1 = Integer.parseInt(harga1.getText());
int b1 = Integer.parseInt(jml1.getText());
int t1 = a1*b1;
total1.setText(""+t1);
int a2 = Integer.parseInt(harga2.getText());
int b2 = Integer.parseInt(jml2.getText());
int t2 = a2*b2;
total2.setText(""+t2);
int a3 = Integer.parseInt(harga3.getText());
int b3 = Integer.parseInt(jml3.getText());
int t3 = a3*b3;
total3.setText(""+t3);
int a4 = Integer.parseInt(harga4.getText());
int b4 = Integer.parseInt(jml4.getText());
int t4 = a4*b4;
total4.setText(""+t4);
int c1 = Integer.parseInt(total1.getText());
int c2 = Integer.parseInt(total2.getText());
int c3 = Integer.parseInt(total3.getText());
int c4 = Integer.parseInt(total4.getText());
int hasil = c1+c2+c3+c4;
totalbiaya.setText(""+hasil);
}
private void total1ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
}
private void total3ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
}
private void selanjutnyaActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
new datapelanggan().setVisible(true);
this.setVisible(false);
}
/**
* @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(MenuResto.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(MenuResto.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(MenuResto.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(MenuResto.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}
//</editor-fold>
/* Create and display the form */
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new MenuResto().setVisible(true);
}
});
}
// Variables declaration - do not modify
private javax.swing.JButton ayam;
private javax.swing.JButton esjeruk;
private javax.swing.JButton eskelapa;
private javax.swing.JButton esteh;
private javax.swing.JTextField harga1;
private javax.swing.JTextField harga2;
private javax.swing.JTextField harga3;
private javax.swing.JTextField harga4;
private javax.swing.JButton ikan;
private javax.swing.JButton jButton1;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel10;
private javax.swing.JLabel jLabel11;
private javax.swing.JLabel jLabel12;
private javax.swing.JLabel jLabel13;
private javax.swing.JLabel jLabel14;
private javax.swing.JLabel jLabel15;
private javax.swing.JLabel jLabel16;
private javax.swing.JLabel jLabel17;
private javax.swing.JLabel jLabel18;
private javax.swing.JLabel jLabel19;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel20;
private javax.swing.JLabel jLabel21;
private javax.swing.JLabel jLabel22;
private javax.swing.JLabel jLabel23;
private javax.swing.JLabel jLabel24;
private javax.swing.JLabel jLabel25;
private javax.swing.JLabel jLabel26;
private javax.swing.JLabel jLabel27;
private javax.swing.JLabel jLabel28;
private javax.swing.JLabel jLabel29;
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel jLabel30;
private javax.swing.JLabel jLabel31;
private javax.swing.JLabel jLabel4;
private javax.swing.JLabel jLabel5;
private javax.swing.JLabel jLabel6;
private javax.swing.JLabel jLabel7;
private javax.swing.JLabel jLabel8;
private javax.swing.JLabel jLabel9;
private javax.swing.JTextField jml1;
private javax.swing.JTextField jml2;
private javax.swing.JTextField jml3;
private javax.swing.JTextField jml4;
private javax.swing.JButton kangkung;
private javax.swing.JButton kopi;
private javax.swing.JButton menu;
private javax.swing.JTextField nama1;
private javax.swing.JTextField nama2;
private javax.swing.JTextField nama3;
private javax.swing.JTextField nama4;
private javax.swing.JButton nasigoreng;
private javax.swing.JButton nasiputih;
private javax.swing.JButton proses;
private javax.swing.JButton sayur;
private javax.swing.JButton selanjutnya;
private javax.swing.JTextField total1;
private javax.swing.JTextField total2;
private javax.swing.JTextField total3;
private javax.swing.JTextField total4;
private javax.swing.JTextField totalbiaya;
private javax.swing.JButton udang;
// End of variables declaration
}
- Code Form 2
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/*
* RestoranOnline.java
*
* Created on Jan 13, 2019, 3:05:24 PM
*/
package restoranonline;
import javax.swing.JOptionPane;
/**
*
* @author dell
*/
public class RestoranOnline extends javax.swing.JFrame {
/** Creates new form RestoranOnline */
public RestoranOnline() {
initComponents();
}
/** 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() {
jLabel1 = new javax.swing.JLabel();
jLabel2 = new javax.swing.JLabel();
jButton1 = new javax.swing.JButton();
jButton2 = new javax.swing.JButton();
jLabel3 = new javax.swing.JLabel();
jLabel4 = new javax.swing.JLabel();
jLabel5 = new javax.swing.JLabel();
jLabel6 = new javax.swing.JLabel();
jButton3 = new javax.swing.JButton();
jLabel7 = new javax.swing.JLabel();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
setName(" Menu Utama"); // NOI18N
getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());
jLabel1.setFont(new java.awt.Font("Monospaced", 1, 36));
jLabel1.setText("Raden Resto");
getContentPane().add(jLabel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(176, 11, -1, 33));
jLabel2.setText("Created by : Dimas Bintang");
getContentPane().add(jLabel2, new org.netbeans.lib.awtextra.AbsoluteConstraints(430, 380, -1, -1));
jButton1.setIcon(new javax.swing.ImageIcon("D:\\images.png")); // NOI18N
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
}
});
getContentPane().add(jButton1, new org.netbeans.lib.awtextra.AbsoluteConstraints(320, 100, 170, 150));
jButton2.setIcon(new javax.swing.ImageIcon("D:\\images.jpg")); // NOI18N
jButton2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton2ActionPerformed(evt);
}
});
getContentPane().add(jButton2, new org.netbeans.lib.awtextra.AbsoluteConstraints(90, 100, 180, 150));
jLabel3.setFont(new java.awt.Font("Dialog", 0, 18));
jLabel3.setText("Delivery Order");
getContentPane().add(jLabel3, new org.netbeans.lib.awtextra.AbsoluteConstraints(240, 40, -1, -1));
jLabel4.setFont(new java.awt.Font("Dialog", 0, 18));
jLabel4.setText("Makanan dan Minuman");
getContentPane().add(jLabel4, new org.netbeans.lib.awtextra.AbsoluteConstraints(90, 260, -1, -1));
jLabel5.setFont(new java.awt.Font("Dialog", 0, 18));
jLabel5.setText("Tentang Raden Resto");
getContentPane().add(jLabel5, new org.netbeans.lib.awtextra.AbsoluteConstraints(320, 260, -1, -1));
getContentPane().add(jLabel6, new org.netbeans.lib.awtextra.AbsoluteConstraints(82, 86, -1, -1));
jButton3.setBackground(new java.awt.Color(-16711936,true));
jButton3.setText("Exit");
jButton3.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton3ActionPerformed(evt);
}
});
getContentPane().add(jButton3, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 360, 70, -1));
jLabel7.setIcon(new javax.swing.ImageIcon("D:\\th.jpg")); // NOI18N
jLabel7.setText("jLabel7");
getContentPane().add(jLabel7, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, 570, -1));
pack();
}// </editor-fold>
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
JOptionPane.showMessageDialog(null,"Aplikasi Raden Resto adalah sebuah aplikasi restoran online yang menyajikan makan enak, cepat dan murah. !Raden Resto buka 24Jam!");
System.exit(0);
}
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
new MenuResto().setVisible(true);
this.setVisible(false);
}
private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
if(JOptionPane.showConfirmDialog(null,"Anda Yakin Tidak Jadi Memesan?","Pintu Keluar",
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 */
//<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(RestoranOnline.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(RestoranOnline.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(RestoranOnline.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(RestoranOnline.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}
//</editor-fold>
/* Create and display the form */
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new RestoranOnline().setVisible(true);
}
});
}
// Variables declaration - do not modify
private javax.swing.JButton jButton1;
private javax.swing.JButton jButton2;
private javax.swing.JButton jButton3;
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;
// End of variables declaration
}
- Code Form 3
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/*
* bayar.java
*
* Created on Jan 14, 2019, 11:04:54 AM
*/
package restoranonline;
import javax.swing.JOptionPane;
/**
*
* @author dell
*/
public class datapelanggan extends javax.swing.JFrame {
/** Creates new form bayar */
public datapelanggan() {
initComponents();
tgl.addItem("_");
for(int a=1;a<=31;a++){
tgl.addItem(a);
}
bln.addItem("_");
bln.addItem("Januari");
bln.addItem("Februari");
bln.addItem("Maret");
bln.addItem("April");
bln.addItem("Mei");
bln.addItem("Juni");
bln.addItem("Juli");
bln.addItem("Agustus");
bln.addItem("September");
bln.addItem("Oktober");
bln.addItem("November");
bln.addItem("Desember");
thn.addItem("_");
for(int b=2014;b<=2025;b++){
thn.addItem(b);
}
}
/** 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() {
jTextField1 = new javax.swing.JTextField();
jLabel1 = new javax.swing.JLabel();
jLabel2 = new javax.swing.JLabel();
tgl = new javax.swing.JComboBox();
bln = new javax.swing.JComboBox();
thn = new javax.swing.JComboBox();
jLabel3 = new javax.swing.JLabel();
jTextField2 = new javax.swing.JTextField();
jLabel4 = new javax.swing.JLabel();
jTextField3 = new javax.swing.JTextField();
order = new javax.swing.JButton();
jLabel5 = new javax.swing.JLabel();
jLabel6 = new javax.swing.JLabel();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
setTitle("Data Pelanggan");
getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());
getContentPane().add(jTextField1, new org.netbeans.lib.awtextra.AbsoluteConstraints(160, 70, 386, -1));
jLabel1.setFont(new java.awt.Font("Dialog", 1, 14));
jLabel1.setText("Nama");
getContentPane().add(jLabel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 70, -1, -1));
jLabel2.setFont(new java.awt.Font("Dialog", 1, 14));
jLabel2.setText("Tanggal Pemesanan");
getContentPane().add(jLabel2, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 100, 150, -1));
tgl.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
tglActionPerformed(evt);
}
});
getContentPane().add(tgl, new org.netbeans.lib.awtextra.AbsoluteConstraints(160, 100, 60, -1));
bln.setModel(new javax.swing.DefaultComboBoxModel(new String[] { " ", " " }));
getContentPane().add(bln, new org.netbeans.lib.awtextra.AbsoluteConstraints(240, 100, 84, -1));
getContentPane().add(thn, new org.netbeans.lib.awtextra.AbsoluteConstraints(340, 100, 60, -1));
jLabel3.setFont(new java.awt.Font("Dialog", 1, 14));
jLabel3.setText("Alamat");
getContentPane().add(jLabel3, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 130, -1, -1));
getContentPane().add(jTextField2, new org.netbeans.lib.awtextra.AbsoluteConstraints(160, 130, 390, -1));
jLabel4.setFont(new java.awt.Font("Dialog", 1, 14));
jLabel4.setText("No.Hp");
getContentPane().add(jLabel4, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 160, -1, -1));
getContentPane().add(jTextField3, new org.netbeans.lib.awtextra.AbsoluteConstraints(160, 160, 390, -1));
order.setBackground(new java.awt.Color(-256,true));
order.setText("ORDER");
order.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
orderActionPerformed(evt);
}
});
getContentPane().add(order, new org.netbeans.lib.awtextra.AbsoluteConstraints(260, 190, 110, -1));
jLabel5.setFont(new java.awt.Font("Dialog", 0, 24));
jLabel5.setText("Silahkan isi data dibawah ini untuk proses verifikasi!");
getContentPane().add(jLabel5, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 10, -1, -1));
jLabel6.setIcon(new javax.swing.ImageIcon("D:\\download (3).jpg")); // NOI18N
jLabel6.setText("jLabel6");
getContentPane().add(jLabel6, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, 650, 240));
pack();
}// </editor-fold>
private void tglActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
}
private void orderActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
JOptionPane.showMessageDialog(null,"Terimakasih Atas Pesanan Anda");
JOptionPane.showMessageDialog(null,"Paket Makanan Anda Akan Segera Kami Antar");
System.exit(0);
}
/**
* @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(datapelanggan.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(datapelanggan.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(datapelanggan.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(datapelanggan.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}
//</editor-fold>
/* Create and display the form */
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new datapelanggan().setVisible(true);
}
});
}
// Variables declaration - do not modify
private javax.swing.JComboBox bln;
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.JTextField jTextField1;
private javax.swing.JTextField jTextField2;
private javax.swing.JTextField jTextField3;
private javax.swing.JButton order;
private javax.swing.JComboBox tgl;
private javax.swing.JComboBox thn;
// End of variables declaration
}