private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
        try {
            Class.forName ("com.mysql.jdbc.Driver");
            String urldb="jdbc:mysql://localhost:3306/restaurant";
            String user=main.dbUser;
            String password=main.dbPassword;
            Connection koneksi=java.sql.DriverManager.getConnection(urldb,user,password);
            String strSQL = "SELECT * "
                            + "FROM `pegawai` "
                            + "WHERE `nama` LIKE '"+nama.getText()+"' "
                            + "AND `password` LIKE '"+pswd.getText()+"'";


            Statement st = koneksi.createStatement();
            ResultSet rs = st.executeQuery(strSQL);

            if(rs.next()){
                JOptionPane.showMessageDialog(null,"login sukses");
                main.username = nama.getText();
                this.dispose();
                menu_utama main = new menu_utama();
                main.setLocationRelativeTo(this);
                main.setVisible(true);
            } else{
                JOptionPane.showMessageDialog(null,"username / Password Salah");
            }
            rs.close();
            st.close();
            koneksi.close();
        }catch(ClassNotFoundException cnfe){
            System.out.println("kesalahan saat"+"me-load driver jdbc \n"+cnfe.getMessage());
        }catch(SQLException sqle){
            System.out.println("keslahan saat koneksi atau "+"kesalahan query sql \n"+sqle.getMessage());
        }
    }//GEN-LAST:event_jButton1ActionPerformed