


Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
The java code for creating a splash screen with a progress bar and implementing user authentication using a mysql database. The splash screen appears during program loading and disappears once it's complete, revealing a login form where users enter their credentials to access the application. The code uses joptionpane for error messages and swing components for the graphical user interface.
Typology: Slides
1 / 4
This page cannot be seen from the preview
Don't miss anything!



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); } }