finale.year.stage.agent.AgentScolarite.java Source code

Java tutorial

Introduction

Here is the source code for finale.year.stage.agent.AgentScolarite.java

Source

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package finale.year.stage.agent;

import finale.year.stage.main.Authentification;
import finale.year.stage.main.ModifyProfile;
import finale.year.stage.main.mainF;
import finale.year.stage.utility.Util;
import java.awt.Color;
import java.awt.Dimension;
import javax.swing.SwingUtilities;
import org.json.JSONException;
import org.json.JSONObject;

/**
 *
 * @author philipchicco
 */
public class AgentScolarite extends javax.swing.JFrame {

    /**
     * Creates new form mainAgent
     */
    public AgentScolarite() {
        initComponents();
        getContentPane().setSize(new Dimension(800, 650));
    }

    //Constructor with user Information in JSONObject
    public AgentScolarite(JSONObject userObject) {
        initComponents();
        this.userObject = userObject;
        initUser();
    }

    //Intialise user info in Profile bar 
    public void initUser() {
        try {
            setName(userObject.getString("firstname") + " " + userObject.getString("lastname"));
            setEmail(userObject.getString("email"));
            setTel(userObject.getString("tel"));
            setAddr(userObject.getString("address"));
        } catch (JSONException e) {
            updateStatus("Error in user-info retrieval");
        }
    }

    //Getters for Profile Labels
    public String getEmailLabel() {
        return emailLabel.getText();
    }

    public String getAddrLabel() {
        return addressLabel.getText();
    }

    public String getNameLabel() {
        return userNameLabel.getText();
    }

    public String getTelLabel() {
        return telLabel.getText();
    }

    //Setters for Profile init()
    public void setEmail(String email) {
        emailLabel.setText(getEmailLabel() + " " + email);
    }

    public void setName(String name) {
        userNameLabel.setText(getNameLabel() + " " + name);
    }

    public void setTel(String tel) {
        telLabel.setText(getTelLabel() + " " + tel);
    }

    public void setAddr(String addr) {
        addressLabel.setText(getAddrLabel() + " " + addr);
    }

    //Error Updater
    public void updateStatus(final String message) {
        SwingUtilities.invokeLater(new Runnable() {

            @Override
            public void run() {
                errorStatusBar.setText("");
                errorStatusBar.setForeground(Color.red);
                errorStatusBar.setText(message);
            }
        });
    }

    //
    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {
        java.awt.GridBagConstraints gridBagConstraints;

        jPanel1 = new javax.swing.JPanel();
        jPanel2 = new javax.swing.JPanel();
        photoUser = new javax.swing.JLabel();
        jSeparator2 = new javax.swing.JSeparator();
        userNameLabel = new javax.swing.JLabel();
        addressLabel = new javax.swing.JLabel();
        telLabel = new javax.swing.JLabel();
        logoutBtn = new javax.swing.JButton();
        emailLabel = new javax.swing.JLabel();
        jSeparator1 = new javax.swing.JSeparator();
        errorStatusBar = new javax.swing.JLabel();
        mainTabbedPane = new javax.swing.JTabbedPane();
        accueilPane = new javax.swing.JPanel();
        consulterInfoBtn = new javax.swing.JButton();
        searchBtn = new javax.swing.JButton();
        searchField = new javax.swing.JTextField();
        jScrollPane1 = new javax.swing.JScrollPane();
        agentTextArea = new javax.swing.JTextArea();
        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        idStudent = new javax.swing.JTextField();
        jPanel4 = new javax.swing.JPanel();
        genererScolariteCBox = new javax.swing.JCheckBox();
        ImprimerScolariteCBox = new javax.swing.JCheckBox();
        soumetBtn = new javax.swing.JButton();
        jLabel3 = new javax.swing.JLabel();
        jPanel3 = new javax.swing.JPanel();
        jPanel6 = new javax.swing.JPanel();
        jLabel4 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        jLabel6 = new javax.swing.JLabel();
        jLabel7 = new javax.swing.JLabel();
        jLabel8 = new javax.swing.JLabel();
        nameField = new javax.swing.JTextField();
        surnameField = new javax.swing.JTextField();
        addressField = new javax.swing.JTextField();
        emailField = new javax.swing.JTextField();
        telField = new javax.swing.JTextField();
        submitModifyBtn = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setBackground(new java.awt.Color(2, 95, 155));
        getContentPane().setLayout(new java.awt.GridBagLayout());

        jPanel1.setBackground(new java.awt.Color(85, 172, 238));
        jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Gestion des Scolarites",
                javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.DEFAULT_POSITION,
                new java.awt.Font("Bitstream Charter", 1, 18), new java.awt.Color(246, 237, 233))); // NOI18N
        jPanel1.setPreferredSize(new java.awt.Dimension(900, 650));
        jPanel1.setLayout(new java.awt.GridBagLayout());

        jPanel2.setBackground(new java.awt.Color(110, 210, 105));

        photoUser
                .setIcon(new javax.swing.ImageIcon(getClass().getResource("/Resources/glyphicons-25-parents.png"))); // NOI18N
        photoUser.setText("photo");

        userNameLabel.setText("Name :");
        userNameLabel.setToolTipText("");

        addressLabel.setText("Address :");

        telLabel.setText("Tel :");

        logoutBtn.setText("Log-Out");
        logoutBtn.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                logoutBtnActionPerformed(evt);
            }
        });

        emailLabel.setText("Email :");

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(jPanel2Layout
                .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel2Layout.createSequentialGroup().addGroup(jPanel2Layout
                        .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent(jSeparator2)
                        .addGroup(jPanel2Layout.createSequentialGroup().addContainerGap()
                                .addGroup(jPanel2Layout
                                        .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addComponent(addressLabel, javax.swing.GroupLayout.Alignment.TRAILING,
                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                        .addComponent(photoUser, javax.swing.GroupLayout.DEFAULT_SIZE,
                                                javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                        .addComponent(userNameLabel, javax.swing.GroupLayout.DEFAULT_SIZE,
                                                javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                        .addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
                                                jPanel2Layout.createSequentialGroup().addGap(0, 68, Short.MAX_VALUE)
                                                        .addComponent(logoutBtn).addGap(87, 87, 87))
                                        .addComponent(telLabel, javax.swing.GroupLayout.DEFAULT_SIZE,
                                                javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                        .addComponent(emailLabel, javax.swing.GroupLayout.DEFAULT_SIZE,
                                                javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
                        .addContainerGap()));
        jPanel2Layout.setVerticalGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel2Layout.createSequentialGroup().addContainerGap()
                        .addComponent(photoUser, javax.swing.GroupLayout.PREFERRED_SIZE, 136,
                                javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jSeparator2, javax.swing.GroupLayout.PREFERRED_SIZE, 24,
                                javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18).addComponent(userNameLabel)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(emailLabel).addGap(17, 17, 17).addComponent(addressLabel)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(telLabel)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 138, Short.MAX_VALUE)
                        .addComponent(logoutBtn).addContainerGap()));

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 3;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.gridheight = 2;
        gridBagConstraints.ipadx = 68;
        gridBagConstraints.ipady = 132;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
        gridBagConstraints.insets = new java.awt.Insets(6, 18, 52, 35);
        jPanel1.add(jPanel2, gridBagConstraints);
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 2;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.ipadx = 48;
        gridBagConstraints.ipady = 403;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
        gridBagConstraints.insets = new java.awt.Insets(6, 6, 0, 0);
        jPanel1.add(jSeparator1, gridBagConstraints);
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 0;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
        jPanel1.add(errorStatusBar, gridBagConstraints);

        mainTabbedPane.setTabLayoutPolicy(javax.swing.JTabbedPane.SCROLL_TAB_LAYOUT);

        consulterInfoBtn.setText("Consulter Info");

        searchBtn.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Resources/glyphicons-28-search.png"))); // NOI18N

        searchField.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                searchFieldActionPerformed(evt);
            }
        });

        agentTextArea.setColumns(20);
        agentTextArea.setRows(5);
        jScrollPane1.setViewportView(agentTextArea);

        jLabel1.setText("Email");

        jLabel2.setText("----StatusError------");

        genererScolariteCBox.setText("Generer Scolarite");

        ImprimerScolariteCBox.setText("Imprimer");

        soumetBtn.setText("soumet");
        soumetBtn.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                soumetBtnActionPerformed(evt);
            }
        });

        jLabel3.setText("IDEtudiant");

        javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
        jPanel4.setLayout(jPanel4Layout);
        jPanel4Layout.setHorizontalGroup(jPanel4Layout
                .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel4Layout.createSequentialGroup().addContainerGap()
                        .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addGroup(jPanel4Layout.createSequentialGroup().addComponent(ImprimerScolariteCBox)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED,
                                                javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                        .addComponent(soumetBtn))
                                .addGroup(jPanel4Layout.createSequentialGroup().addComponent(genererScolariteCBox)
                                        .addGap(0, 0, Short.MAX_VALUE)))
                        .addContainerGap())
                .addGroup(jPanel4Layout.createSequentialGroup().addGap(115, 115, 115).addComponent(jLabel3)
                        .addContainerGap(119, Short.MAX_VALUE)));
        jPanel4Layout.setVerticalGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel4Layout.createSequentialGroup()
                        .addContainerGap().addComponent(jLabel3)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 22, Short.MAX_VALUE)
                        .addComponent(genererScolariteCBox)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(ImprimerScolariteCBox).addComponent(soumetBtn))
                        .addGap(10, 10, 10)));

        javax.swing.GroupLayout accueilPaneLayout = new javax.swing.GroupLayout(accueilPane);
        accueilPane.setLayout(accueilPaneLayout);
        accueilPaneLayout.setHorizontalGroup(accueilPaneLayout
                .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(accueilPaneLayout.createSequentialGroup().addContainerGap().addGroup(accueilPaneLayout
                        .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent(jScrollPane1)
                        .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, accueilPaneLayout
                                .createSequentialGroup().addGap(0, 0, Short.MAX_VALUE).addComponent(jLabel1)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(searchField, javax.swing.GroupLayout.PREFERRED_SIZE, 415,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(searchBtn))
                        .addGroup(accueilPaneLayout.createSequentialGroup().addComponent(consulterInfoBtn)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addGroup(accueilPaneLayout
                                        .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addGroup(accueilPaneLayout.createSequentialGroup()
                                                .addGap(0, 0, Short.MAX_VALUE).addComponent(jPanel4,
                                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                                        javax.swing.GroupLayout.DEFAULT_SIZE,
                                                        javax.swing.GroupLayout.PREFERRED_SIZE))
                                        .addGroup(accueilPaneLayout.createSequentialGroup()
                                                .addComponent(idStudent, javax.swing.GroupLayout.PREFERRED_SIZE,
                                                        157, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addGap(0, 0, Short.MAX_VALUE)))))
                        .addContainerGap())
                .addGroup(accueilPaneLayout.createSequentialGroup().addGap(227, 227, 227).addComponent(jLabel2)
                        .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));
        accueilPaneLayout.setVerticalGroup(accueilPaneLayout
                .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(accueilPaneLayout.createSequentialGroup().addContainerGap().addGroup(accueilPaneLayout
                        .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent(searchBtn)
                        .addGroup(accueilPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(searchField, javax.swing.GroupLayout.PREFERRED_SIZE, 35,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(jLabel1)))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 161,
                                javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addComponent(jLabel2)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 47, Short.MAX_VALUE)
                        .addGroup(accueilPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(consulterInfoBtn).addComponent(idStudent,
                                        javax.swing.GroupLayout.PREFERRED_SIZE, 36,
                                        javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 46, Short.MAX_VALUE)
                        .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addContainerGap()));

        mainTabbedPane.addTab("Accueil", accueilPane);

        jPanel6.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0), 3));

        jLabel4.setText("PRENOM");

        jLabel5.setText("NOM");

        jLabel6.setText("ADDRESSE");

        jLabel7.setText("TEL");

        jLabel8.setText("EMAIL");

        nameField.setColumns(30);

        surnameField.setColumns(30);

        addressField.setColumns(30);

        emailField.setColumns(30);

        telField.setColumns(30);
        telField.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                telFieldActionPerformed(evt);
            }
        });

        submitModifyBtn.setText("Soumet");

        javax.swing.GroupLayout jPanel6Layout = new javax.swing.GroupLayout(jPanel6);
        jPanel6.setLayout(jPanel6Layout);
        jPanel6Layout.setHorizontalGroup(jPanel6Layout
                .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel6Layout.createSequentialGroup().addGap(27, 27, 27)
                        .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addComponent(jLabel5).addComponent(jLabel4).addComponent(jLabel6)
                                .addComponent(jLabel8).addComponent(jLabel7))
                        .addGap(26, 26, 26)
                        .addGroup(jPanel6Layout
                                .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                .addComponent(nameField).addComponent(surnameField).addComponent(addressField)
                                .addComponent(emailField, javax.swing.GroupLayout.DEFAULT_SIZE,
                                        javax.swing.GroupLayout.DEFAULT_SIZE,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(telField))
                        .addContainerGap(71, Short.MAX_VALUE))
                .addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
                        jPanel6Layout.createSequentialGroup()
                                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addComponent(submitModifyBtn).addGap(61, 61, 61)));
        jPanel6Layout.setVerticalGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel6Layout.createSequentialGroup().addGap(40, 40, 40)
                        .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(nameField, javax.swing.GroupLayout.PREFERRED_SIZE, 30,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(jLabel4))
                        .addGap(33, 33, 33)
                        .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(surnameField, javax.swing.GroupLayout.PREFERRED_SIZE, 30,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(jLabel5))
                        .addGap(18, 18, 18)
                        .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(addressField, javax.swing.GroupLayout.DEFAULT_SIZE, 30,
                                        Short.MAX_VALUE)
                                .addComponent(jLabel6))
                        .addGap(18, 18, 18)
                        .addGroup(
                                jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                        .addComponent(emailField, javax.swing.GroupLayout.DEFAULT_SIZE, 30,
                                                Short.MAX_VALUE)
                                        .addComponent(jLabel8))
                        .addGap(18, 18, 18)
                        .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(telField, javax.swing.GroupLayout.PREFERRED_SIZE, 30,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(jLabel7))
                        .addGap(26, 26, 26).addComponent(submitModifyBtn).addGap(53, 53, 53)));

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(jPanel3Layout
                .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel3Layout.createSequentialGroup().addGap(50, 50, 50)
                        .addComponent(jPanel6, javax.swing.GroupLayout.PREFERRED_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));
        jPanel3Layout.setVerticalGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel3Layout.createSequentialGroup().addGap(34, 34, 34)
                        .addComponent(jPanel6, javax.swing.GroupLayout.PREFERRED_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addContainerGap(64, Short.MAX_VALUE)));

        mainTabbedPane.addTab("Modifier Profile", jPanel3);

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.gridheight = 2;
        gridBagConstraints.ipadx = 48;
        gridBagConstraints.ipady = 54;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
        gridBagConstraints.insets = new java.awt.Insets(6, 12, 52, 0);
        jPanel1.add(mainTabbedPane, gridBagConstraints);

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 0;
        gridBagConstraints.ipady = 54;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
        getContentPane().add(jPanel1, gridBagConstraints);

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void searchFieldActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_searchFieldActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_searchFieldActionPerformed

    private void soumetBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_soumetBtnActionPerformed
        // TODO add your handling code here:

    }//GEN-LAST:event_soumetBtnActionPerformed

    private void logoutBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_logoutBtnActionPerformed
        // TODO add your handling code here:
        if (Util.userFile != null)
            Util.emptyFile();
        else
            System.err.println("Error in File Deletion");

        //Open Login PAGE
        mainF.mainFrame.dispose();
        this.dispose();
        mainFrame = new mainF();
        mainFrame.launchFrame(new Authentification(), mainFrame);
    }//GEN-LAST:event_logoutBtnActionPerformed

    private void telFieldActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_telFieldActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_telFieldActionPerformed

    /**
     * @Agent Thread Manager
     */
    private class AgentThread extends Thread {
        private String name = null;
        private String surname = null;
        private String addresse = null;
        private String tel = null;
        private String email = null;

    }

    /**
     * @param args the command line arguments
     * final JSONObject userObject
     */
    public static void main(final JSONObject userObject) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(AgentScolarite.class.getName()).log(java.util.logging.Level.SEVERE,
                    null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(AgentScolarite.class.getName()).log(java.util.logging.Level.SEVERE,
                    null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(AgentScolarite.class.getName()).log(java.util.logging.Level.SEVERE,
                    null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(AgentScolarite.class.getName()).log(java.util.logging.Level.SEVERE,
                    null, ex);
        }
        //</editor-fold>
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new AgentScolarite(userObject).setVisible(true);
                //new AgentScolarite().setVisible(true);
            }
        });
    }

    private static mainF mainFrame = null;
    ModifyProfile profile = null;
    public static JSONObject userObject = null;
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JCheckBox ImprimerScolariteCBox;
    private javax.swing.JPanel accueilPane;
    private javax.swing.JTextField addressField;
    private javax.swing.JLabel addressLabel;
    private javax.swing.JTextArea agentTextArea;
    private javax.swing.JButton consulterInfoBtn;
    private javax.swing.JTextField emailField;
    private javax.swing.JLabel emailLabel;
    private javax.swing.JLabel errorStatusBar;
    private javax.swing.JCheckBox genererScolariteCBox;
    private javax.swing.JTextField idStudent;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JPanel jPanel6;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JSeparator jSeparator1;
    private javax.swing.JSeparator jSeparator2;
    private javax.swing.JButton logoutBtn;
    private javax.swing.JTabbedPane mainTabbedPane;
    private javax.swing.JTextField nameField;
    private javax.swing.JLabel photoUser;
    private javax.swing.JButton searchBtn;
    private javax.swing.JTextField searchField;
    private javax.swing.JButton soumetBtn;
    private javax.swing.JButton submitModifyBtn;
    private javax.swing.JTextField surnameField;
    private javax.swing.JTextField telField;
    private javax.swing.JLabel telLabel;
    private javax.swing.JLabel userNameLabel;
    // End of variables declaration//GEN-END:variables
}