Docsity

Java Code for Splash Screen and User Authentication, Slides of Java Programming

Partial preview of the text

Download Java Code for Splash Screen and User Authentication and more Slides Java Programming in PDF only on Docsity!

Splash Form code NB: MAIN () METHOD AYAA LAGU QORAYAA CODE-KAN Splash s =new Splash(); s.setVisible(true); s.setLocationRelativeTo(null); frmLogIn lg=new frmLogIn(); try { for(int i=0; i<=100; i++) { Thread.sleep(100); s.loadnum.setText(Integer.toString(i) +"%"); s.loadbar.setValue(i); if(i==100) { s.dispose();

lg.setVisible(true); lg.setLocationRelativeTo(null); } } } catch (Exception e) { JOptionPane.showMessageDialog(null, e); }

Statement std = (Statement) con.createStatement(); ResultSet rs; rs=std.executeQuery(qry); if (rs.next()) { MDI frm = new MDI(); frm.show(); frm.setExtendedState(frm.MAXIMIZED_BOTH); this.hide(); con.close(); } else { con.close(); JOptionPane.showMessageDialog(null, "Your User Name or Password is incorrect"); txtname.setText(""); txtpwd.setText(""); txtname.requestFocus(); } } catch (Exception e) { JOptionPane.showMessageDialog(this, e); } }