0% found this document useful (0 votes)
7 views7 pages

Doc1

The document contains Java code for a login and registration system, including methods for validating user credentials, handling button actions for registration, and managing a progress bar. It features user interface elements such as text fields and buttons for login, registration, and cancellation. Additionally, it includes a main class that initializes the progress bar and transitions to the login screen after completion.

Uploaded by

Abel Letshu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views7 pages

Doc1

The document contains Java code for a login and registration system, including methods for validating user credentials, handling button actions for registration, and managing a progress bar. It features user interface elements such as text fields and buttons for login, registration, and cancellation. Additionally, it includes a main class that initializes the progress bar and transitions to the login screen after completion.

Uploaded by

Abel Letshu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 7

Résolutions

Code et image du fichier connexion.java

Buton valider

private void validerActionPerformed (java.awt.event.ActionEvent evt) {

String user="Admin";

String pass="12345";

String field1= jTextField1.getText();

String field2=String.valueOf(jPasswordField1.getPassword());
if(field1.equals(user) && field2.equals(pass)){

Connexion.super.dispose();

new Inscription().setVisible(true);

else

JOptionPane.showMessageDialog(this,"identifiant ou mot de passe incorrect");

Bouton annuler

private void annulerActionPerformed(java.awt.event.ActionEvent evt) {

jTextField1.setText(" ");

jPasswordField1.setText("");

// TODO add your handling code here:

Bouton du bouton exit


private void exitActionPerformed(java.awt.event.ActionEvent evt) {
System.exit(0);
// TODO add your handling code here:
}

Code et image du fichier Inscription.java


Bouton s’inscrire

private void inscrireActionPerformed(java.awt.event.ActionEvent evt) {

if("".equals(jTextField1.getText())&& "".equals(jTextField2.getText())&&
"".equals(jTextField3.getText())&&"".equals(jTextField4.getText()))

JOptionPane.showMessageDialog(this, "veuillez remplir tous les


champs");

else

String
tbData[]={jTextField1.getText(),jTextField2.getText(),jTextField3.getText() ,jTextFi
eld4.getText(),jComboBox1.getSelectedItem().toString(),jComboBox2.getSelecte
dItem().toString(),jComboBox3.getSelectedItem().toString(),jComboBox4.getSel
ectedItem().toString()};

DefaultTableModel tbModel =(DefaultTableModel)jTable1.getModel();

tbModel.addRow(tbData);

}
Bouton Annuler

private void annulerActionPerformed(java.awt.event.ActionEvent evt) {

jTextField1.setText("");

jTextField2.setText("");

jTextField3.setText("");

jTextField4.setText("");

// TODO add your handling code here:

Bouton Retour

private void retourActionPerformed(java.awt.event.ActionEvent evt)

Inscription.super.dispose();

new Connexion().setVisible(true);

// TODO add your handling code here:

Code et image du fichier MyBarre.java


package ecole

public class MyBarre {

public static void main(String [] args)


{
Progress ho = new Progress();

// Home is name of the jFrame


ho.setVisible(true);

try {
for(int x = 0; x <=100; x++)
{
Thread.sleep(120);

Progress.jLabel2.setText(Integer.toString(x)+"%");
Progress.jProgressBar1.setValue(x);

}
} catch (Exception e) {
}
ho.setVisible(false);
new Connexion().setVisible(true);
}
}

image du fichier Progress.java


Le fichier Progress est relié au fichier MyBarre.java

You might also like