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

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

2019/2020

Uploaded on 05/27/2020

Axmed-Qadar
Axmed-Qadar 🇸🇴

3 documents

1 / 4

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
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();
pf3
pf4

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