Aplikasi hotel menggunakan netbeans dan mysql
Assalamualaikum. WR. WB
Berikut saya akan menjelaskan bagai mana cara membuat aplikasi registrasi hotel menggunakan java netbeans dan juga menggunakan database Mysql. di dalam aplikasi ini terdapat Login dan Registrasi. Berikut flowchart dan caranya :
Berikut cara membuat from login :
Berikut saya akan menjelaskan bagai mana cara membuat aplikasi registrasi hotel menggunakan java netbeans dan juga menggunakan database Mysql. di dalam aplikasi ini terdapat Login dan Registrasi. Berikut flowchart dan caranya :
Berikut cara membuat from login :
package a;
import javax.swing.JOptionPane;
/**
*
* @author Yuri
*/
public class Login extends javax.swing.JFrame {
/**
* Creates new form Login
*/
public Login() {
initComponents();
}
/**
jLabel1 = new javax.swing.JLabel();
jLabel2 = new javax.swing.JLabel();
PassTxt = new javax.swing.JTextField();
userTxt = new javax.swing.JTextField();
jButton1 = new javax.swing.JButton();
jButton2 = new javax.swing.JButton();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
jLabel1.setText("User");
jLabel2.setText("Password");
PassTxt.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
PassTxtActionPerformed(evt);
}
});
jButton1.setText("LOGIN");
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
}
});
jButton2.setText("CLOSE");
jButton2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton2ActionPerformed(evt);
}
});
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(23, 23, 23)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(jLabel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addGap(47, 47, 47)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(PassTxt, javax.swing.GroupLayout.PREFERRED_SIZE, 109, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(userTxt, javax.swing.GroupLayout.PREFERRED_SIZE, 109, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addGroup(layout.createSequentialGroup()
.addGap(37, 37, 37)
.addComponent(jButton1)
.addGap(40, 40, 40)
.addComponent(jButton2)))
.addContainerGap(175, Short.MAX_VALUE))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(55, 55, 55)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel1)
.addComponent(userTxt, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(21, 21, 21)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel2)
.addComponent(PassTxt, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(35, 35, 35)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jButton1)
.addComponent(jButton2))
.addContainerGap(126, Short.MAX_VALUE))
);
pack();
}// </editor-fold>
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
if(userTxt.getText().equals("catur")){
if(PassTxt.getText().equals("yuri")){
new cekin().show();
this.dispose();
}else{
JOptionPane.showConfirmDialog(rootPane,"Password salah silahkan"+"ulangi");
PassTxt.setText("");
PassTxt.requestFocus();
}
}else{
JOptionPane.showConfirmDialog(rootPane,"Username salah silahkan"+"ulangi");
userTxt.setText("");
PassTxt.setText("");
PassTxt.requestFocus();
}
}
private void PassTxtActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
}
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
if(JOptionPane.showConfirmDialog(null,"Yakin Keluar?", "Yakin",JOptionPane.YES_NO_OPTION)
== JOptionPane.YES_NO_OPTION){
System.exit(0);
}
}
Dan selanjutnya anda buat database yang di perlukan untuk program hotel ini :
Komentar
Posting Komentar