What is java GUI ?
GUI stands for Graphical User Interface, a time period used not best in Java however in all programming languages that guide the improvement of GUIs. A software’s graphical consumer interface affords an easy-to-use visual display to the person.
Source code for admin login of the project.
- Sells and calculations.
try{
String sql = "select username,password from admin where username=? and password=? ";
pst = con.prepareStatement(sql);
pst.setString(1, jTextField1.getText());
pst.setString(2, jPasswordField1.getText());
rs = pst.executeQuery();
if(rs.next()){
dispose();
new SellAndCalculate().setVisible(true);
}else{
JOptionPane.showMessageDialog(null, "Wrong Infogmation","Error",JOptionPane.ERROR_MESSAGE);
}
}catch(Exception e){
JOptionPane.showMessageDialog(null, e);
}
2. Restaurant information update.
try{
String sql = "select password from admin where password=? ";
pst = con.prepareStatement(sql);
pst.setString(1, jPasswordField2.getText());
rs = pst.executeQuery();
if(rs.next()){
dispose();
new UpdateAndInsert().setVisible(true);
}else{
JOptionPane.showMessageDialog(null, "Wrong Infogmation","Error",JOptionPane.ERROR_MESSAGE);
}
}catch(Exception e){
JOptionPane.showMessageDialog(null, e);
}
3. Restaurant owner access…
try{
String sql = "select username,password from owner where username=? and password=? ";
pst = con.prepareStatement(sql);
pst.setString(1, jTextField2.getText());
pst.setString(2, jPasswordField3.getText());
rs = pst.executeQuery();
if(rs.next()){
dispose();
new Owner().setVisible(true);
}else{
JOptionPane.showMessageDialog(null, "Wrong Infogmation","Error",JOptionPane.ERROR_MESSAGE);
}
}catch(Exception e){
JOptionPane.showMessageDialog(null, e);
}
Be First to Comment