finale.year.stage.responsable.ResponsableInterface.java Source code

Java tutorial

Introduction

Here is the source code for finale.year.stage.responsable.ResponsableInterface.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.responsable;

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.util.Iterator;
import javax.swing.JOptionPane;
import javax.swing.SwingUtilities;
import org.json.JSONException;
import org.json.JSONObject;

/**
 *
 * @author philipchicco
 */
public class ResponsableInterface extends javax.swing.JPanel {

    /**
     * Creates new form ResponsableInterface
     */
    public ResponsableInterface() {
        initComponents();
    }

    //Constructor with user object containing information about the user.
    public ResponsableInterface(JSONObject userObject) {
        initComponents();
        this.userObject = userObject;
        initUser();
        activateaAddPanel(false);

    }

    public void initUser() {
        try {
            setNameLabel(userObject.getString("firstname") + " " + userObject.getString("lastname"));
            setEmailLabel(userObject.getString("email"));
            setAddrLabel(userObject.getString("address"));
            setTelLabel(userObject.getString("tel"));

        } catch (JSONException ex) {
            updateStatus("Error in user info-retrieval");
            //ex.printStackTrace();
        }

    }

    /**
     * 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.
     */
    //Getters and Setters for the User Profile Section
    public String getNameLabel() {
        return nameLabel.getText();
    }

    private String getEmail() {
        return emailLabel.getText();
    }

    private String getTel() {
        return telLabel.getText();
    }

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

    //Setters 
    public void setNameLabel(String newname) {
        nameLabel.setText(getNameLabel() + " " + newname);
    }

    public void setTelLabel(String newname) {
        telLabel.setText(getTel() + " " + newname);
    }

    public void setAddrLabel(String address) {
        addressLabel.setText(getAddr() + " " + address);
    }

    public void setEmailLabel(String email) {
        emailLabel.setText(getEmail() + " " + email);
    }

    ///ErrorStatus Bar Updates
    public static void updateStatus(final String message) {
        SwingUtilities.invokeLater(new Runnable() {

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

    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {
        java.awt.GridBagConstraints gridBagConstraints;

        recBtnGroup = new javax.swing.ButtonGroup();
        jPanel1 = new javax.swing.JPanel();
        photoLabel = new javax.swing.JLabel();
        emailLabel = new javax.swing.JLabel();
        addressLabel = new javax.swing.JLabel();
        telLabel = new javax.swing.JLabel();
        modifyBtn = new javax.swing.JButton();
        nameLabel = new javax.swing.JLabel();
        logoutBtn = new javax.swing.JButton();
        jSeparator2 = new javax.swing.JSeparator();
        jSeparator1 = new javax.swing.JSeparator();
        mainPane = new javax.swing.JTabbedPane();
        themesTabPane = new javax.swing.JTabbedPane();
        jPanel2 = new javax.swing.JPanel();
        listStudents = new javax.swing.JButton();
        jScrollPane1 = new javax.swing.JScrollPane();
        jTextArea1 = new javax.swing.JTextArea();
        searchBtn = new javax.swing.JButton();
        searchField = new javax.swing.JTextField();
        jLabel1 = new javax.swing.JLabel();
        jButton8 = new javax.swing.JButton();
        jTabbedPane1 = new javax.swing.JTabbedPane();
        jPanel3 = new javax.swing.JPanel();
        jScrollPane2 = new javax.swing.JScrollPane();
        themeMainArea = new javax.swing.JTextArea();
        listThemeBtn = new javax.swing.JButton();
        addThemeBtn = new javax.swing.JButton();
        addThemePanel = new javax.swing.JPanel();
        themeTitleField = new javax.swing.JTextField();
        themeTitleLabel = new javax.swing.JLabel();
        jScrollPane3 = new javax.swing.JScrollPane();
        themeDescripArea = new javax.swing.JTextArea();
        descripLabel = new javax.swing.JLabel();
        submitThemeBtn = new javax.swing.JButton();
        cancelThemeBtn = new javax.swing.JButton();
        deleteThemeBtn = new javax.swing.JButton();
        modifyThemeBtn = new javax.swing.JButton();
        idFieldThemeDelete = new javax.swing.JTextField();
        idThemeLabel = new javax.swing.JLabel();
        reclammationsPane = new javax.swing.JTabbedPane();
        recPanel = new javax.swing.JPanel();
        jScrollPane4 = new javax.swing.JScrollPane();
        jTextArea2 = new javax.swing.JTextArea();
        ListRecBtn = new javax.swing.JButton();
        reclammationTransferPanel = new javax.swing.JPanel();
        idReclammation = new javax.swing.JTextField();
        jLabel2 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        transferRecBtn = new javax.swing.JButton();
        valideRBtn = new javax.swing.JRadioButton();
        invalidRBtn = new javax.swing.JRadioButton();
        ViewRecBtn = new javax.swing.JButton();
        reclammationIDViewField = new javax.swing.JTextField();
        jLabel6 = new javax.swing.JLabel();
        deleteRecBtn = new javax.swing.JButton();
        deliberationPane = new javax.swing.JTabbedPane();
        jPanel4 = new javax.swing.JPanel();
        jScrollPane5 = new javax.swing.JScrollPane();
        jTextArea3 = new javax.swing.JTextArea();
        jButton1 = new javax.swing.JButton();
        jButton2 = new javax.swing.JButton();
        jButton3 = new javax.swing.JButton();
        jTabbedPane2 = new javax.swing.JTabbedPane();
        jPanel6 = new javax.swing.JPanel();
        jScrollPane6 = new javax.swing.JScrollPane();
        jTextArea4 = new javax.swing.JTextArea();
        jButton4 = new javax.swing.JButton();
        jPanel7 = new javax.swing.JPanel();
        jLabel3 = new javax.swing.JLabel();
        jTextField1 = new javax.swing.JTextField();
        jButton5 = new javax.swing.JButton();
        jButton6 = new javax.swing.JButton();
        jButton7 = new javax.swing.JButton();
        errorStatusBar = new javax.swing.JLabel();

        setBackground(new java.awt.Color(85, 172, 238));
        setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Gestion de Stage",
                javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.ABOVE_TOP,
                new java.awt.Font("Abyssinica SIL", 0, 14), new java.awt.Color(0, 0, 0))); // NOI18N
        setLayout(new java.awt.GridBagLayout());

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

        photoLabel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Resources/glyphicons_user.png"))); // NOI18N

        emailLabel.setText("Email  :");

        addressLabel.setText("Address :");

        telLabel.setText("Tel :");

        modifyBtn.setText("Modify ");
        modifyBtn.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                modifyBtnActionPerformed(evt);
            }
        });

        nameLabel.setText("Name :");

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

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(jPanel1Layout
                .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel1Layout.createSequentialGroup().addContainerGap().addGroup(jPanel1Layout
                        .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addComponent(photoLabel, javax.swing.GroupLayout.Alignment.TRAILING,
                                javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
                                Short.MAX_VALUE)
                        .addGroup(jPanel1Layout.createSequentialGroup().addGroup(jPanel1Layout
                                .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addComponent(jSeparator2)
                                .addGroup(jPanel1Layout.createSequentialGroup().addComponent(logoutBtn)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 30,
                                                Short.MAX_VALUE)
                                        .addComponent(modifyBtn))
                                .addGroup(jPanel1Layout.createSequentialGroup()
                                        .addGroup(jPanel1Layout
                                                .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                .addComponent(emailLabel).addComponent(addressLabel)
                                                .addComponent(telLabel).addComponent(nameLabel))
                                        .addGap(0, 0, Short.MAX_VALUE)))
                                .addContainerGap()))));
        jPanel1Layout.setVerticalGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel1Layout.createSequentialGroup().addContainerGap()
                        .addComponent(photoLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 201,
                                javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(3, 3, 3)
                        .addComponent(jSeparator2, javax.swing.GroupLayout.PREFERRED_SIZE, 9,
                                javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addComponent(nameLabel)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(emailLabel)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(addressLabel)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(telLabel)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED,
                                javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(modifyBtn).addComponent(logoutBtn))
                        .addContainerGap()));

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 3;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.ipadx = 24;
        gridBagConstraints.ipady = 258;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
        gridBagConstraints.insets = new java.awt.Insets(53, 6, 5, 5);
        add(jPanel1, gridBagConstraints);
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 2;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.ipadx = 21;
        gridBagConstraints.ipady = 627;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
        gridBagConstraints.insets = new java.awt.Insets(53, 6, 5, 0);
        add(jSeparator1, gridBagConstraints);

        mainPane.setTabLayoutPolicy(javax.swing.JTabbedPane.SCROLL_TAB_LAYOUT);
        mainPane.setTabPlacement(javax.swing.JTabbedPane.LEFT);

        listStudents.setText("LIster Etudiants");

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

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

        jLabel1.setText("Consult Information");

        jButton8.setText("Voir Etat");

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(jPanel2Layout
                .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel2Layout.createSequentialGroup().addContainerGap().addGroup(jPanel2Layout
                        .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent(jScrollPane1)
                        .addGroup(jPanel2Layout.createSequentialGroup()
                                .addComponent(searchBtn, javax.swing.GroupLayout.PREFERRED_SIZE, 52,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addGroup(jPanel2Layout
                                        .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addComponent(searchField, javax.swing.GroupLayout.PREFERRED_SIZE, 474,
                                                javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addComponent(jLabel1)
                                        .addGroup(jPanel2Layout
                                                .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING,
                                                        false)
                                                .addComponent(jButton8, javax.swing.GroupLayout.Alignment.LEADING,
                                                        javax.swing.GroupLayout.DEFAULT_SIZE,
                                                        javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                                .addComponent(listStudents,
                                                        javax.swing.GroupLayout.Alignment.LEADING,
                                                        javax.swing.GroupLayout.DEFAULT_SIZE,
                                                        javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                                .addGap(0, 176, Short.MAX_VALUE)))
                        .addContainerGap()));
        jPanel2Layout.setVerticalGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 376, Short.MAX_VALUE)
                        .addGap(18, 18, 18)
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
                                        jPanel2Layout.createSequentialGroup().addComponent(jLabel1)
                                                .addPreferredGap(
                                                        javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                                .addComponent(searchField, javax.swing.GroupLayout.PREFERRED_SIZE,
                                                        28, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addComponent(searchBtn, javax.swing.GroupLayout.Alignment.TRAILING,
                                        javax.swing.GroupLayout.PREFERRED_SIZE, 28,
                                        javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(18, 18, 18).addComponent(listStudents).addGap(18, 18, 18).addComponent(jButton8)
                        .addGap(47, 47, 47)));

        themesTabPane.addTab("Etat de Stage", jPanel2);

        mainPane.addTab("Home", themesTabPane);

        themeMainArea.setEditable(false);
        themeMainArea.setColumns(20);
        themeMainArea.setRows(5);
        jScrollPane2.setViewportView(themeMainArea);

        listThemeBtn.setText("Lister");
        listThemeBtn.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                listThemeBtnActionPerformed(evt);
            }
        });

        addThemeBtn.setText("Proposer ");
        addThemeBtn.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                addThemeBtnActionPerformed(evt);
            }
        });

        themeTitleLabel.setText("Titre : ");

        themeDescripArea.setColumns(20);
        themeDescripArea.setRows(5);
        jScrollPane3.setViewportView(themeDescripArea);

        descripLabel.setText("Description");

        submitThemeBtn.setText("Soumettre");
        submitThemeBtn.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                submitThemeBtnActionPerformed(evt);
            }
        });

        cancelThemeBtn.setText("Annuler");
        cancelThemeBtn.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                cancelThemeBtnActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout addThemePanelLayout = new javax.swing.GroupLayout(addThemePanel);
        addThemePanel.setLayout(addThemePanelLayout);
        addThemePanelLayout.setHorizontalGroup(addThemePanelLayout
                .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(addThemePanelLayout.createSequentialGroup().addContainerGap().addGroup(addThemePanelLayout
                        .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(addThemePanelLayout.createSequentialGroup()
                                .addGroup(addThemePanelLayout
                                        .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addComponent(themeTitleLabel).addComponent(descripLabel))
                                .addGap(25, 25, 25)
                                .addGroup(addThemePanelLayout
                                        .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addComponent(themeTitleField).addComponent(jScrollPane3,
                                                javax.swing.GroupLayout.DEFAULT_SIZE, 299, Short.MAX_VALUE)))
                        .addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
                                addThemePanelLayout.createSequentialGroup().addGap(0, 0, Short.MAX_VALUE)
                                        .addComponent(cancelThemeBtn).addGap(18, 18, 18)
                                        .addComponent(submitThemeBtn)))
                        .addContainerGap()));
        addThemePanelLayout.setVerticalGroup(addThemePanelLayout
                .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(addThemePanelLayout.createSequentialGroup().addContainerGap().addGroup(addThemePanelLayout
                        .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addComponent(themeTitleLabel).addComponent(themeTitleField,
                                javax.swing.GroupLayout.PREFERRED_SIZE, 27, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGroup(addThemePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addGroup(addThemePanelLayout.createSequentialGroup().addGap(10, 10, 10)
                                        .addComponent(descripLabel).addContainerGap(267, Short.MAX_VALUE))
                                .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, addThemePanelLayout
                                        .createSequentialGroup()
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED,
                                                javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                        .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 191,
                                                javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                        .addGroup(addThemePanelLayout
                                                .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                                .addComponent(submitThemeBtn).addComponent(cancelThemeBtn))
                                        .addGap(11, 11, 11)))));

        deleteThemeBtn.setText("Supprimer");
        deleteThemeBtn.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                deleteThemeBtnActionPerformed(evt);
            }
        });

        modifyThemeBtn.setText("Modifier");
        modifyThemeBtn.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                modifyThemeBtnActionPerformed(evt);
            }
        });

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

        idThemeLabel.setText("ID Theme");

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(jPanel3Layout
                .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel3Layout.createSequentialGroup().addContainerGap().addGroup(jPanel3Layout
                        .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                        .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 698,
                                javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGroup(jPanel3Layout.createSequentialGroup().addGroup(jPanel3Layout
                                .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addGroup(jPanel3Layout.createSequentialGroup().addComponent(addThemeBtn)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                        .addComponent(listThemeBtn))
                                .addComponent(idThemeLabel)
                                .addGroup(jPanel3Layout
                                        .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                        .addComponent(idFieldThemeDelete, javax.swing.GroupLayout.Alignment.LEADING)
                                        .addGroup(javax.swing.GroupLayout.Alignment.LEADING,
                                                jPanel3Layout.createSequentialGroup().addComponent(deleteThemeBtn)
                                                        .addGap(42, 42, 42).addComponent(modifyThemeBtn))))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED,
                                        javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addComponent(addThemePanel, javax.swing.GroupLayout.PREFERRED_SIZE,
                                        javax.swing.GroupLayout.DEFAULT_SIZE,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)))
                        .addContainerGap(34, Short.MAX_VALUE)));
        jPanel3Layout.setVerticalGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel3Layout.createSequentialGroup().addContainerGap()
                        .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 233,
                                javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addGroup(jPanel3Layout.createSequentialGroup()
                                        .addComponent(addThemePanel, javax.swing.GroupLayout.DEFAULT_SIZE,
                                                javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                        .addContainerGap())
                                .addGroup(jPanel3Layout.createSequentialGroup()
                                        .addGroup(jPanel3Layout
                                                .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                                .addComponent(addThemeBtn).addComponent(listThemeBtn))
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED,
                                                javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                        .addComponent(idThemeLabel)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(idFieldThemeDelete, javax.swing.GroupLayout.PREFERRED_SIZE,
                                                25, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                        .addGroup(jPanel3Layout
                                                .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                                .addComponent(deleteThemeBtn).addComponent(modifyThemeBtn))
                                        .addGap(82, 82, 82)))));

        jTabbedPane1.addTab("Gestion de Themes", jPanel3);

        mainPane.addTab("Themes", jTabbedPane1);

        jTextArea2.setColumns(20);
        jTextArea2.setRows(5);
        jScrollPane4.setViewportView(jTextArea2);

        ListRecBtn.setText("Lister");

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

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

        jLabel2.setText("ID :");

        jLabel5.setForeground(new java.awt.Color(255, 51, 51));
        jLabel5.setText("Transfer Un Reclammation");

        transferRecBtn.setText("Transfer");

        recBtnGroup.add(valideRBtn);
        valideRBtn.setText("Valide");

        recBtnGroup.add(invalidRBtn);
        invalidRBtn.setText("invalide");

        javax.swing.GroupLayout reclammationTransferPanelLayout = new javax.swing.GroupLayout(
                reclammationTransferPanel);
        reclammationTransferPanel.setLayout(reclammationTransferPanelLayout);
        reclammationTransferPanelLayout.setHorizontalGroup(reclammationTransferPanelLayout
                .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(reclammationTransferPanelLayout.createSequentialGroup()
                        .addContainerGap(25, Short.MAX_VALUE)
                        .addGroup(reclammationTransferPanelLayout
                                .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
                                        reclammationTransferPanelLayout.createSequentialGroup()
                                                .addComponent(jLabel2).addGap(2, 2, 2)
                                                .addGroup(reclammationTransferPanelLayout
                                                        .createParallelGroup(
                                                                javax.swing.GroupLayout.Alignment.LEADING)
                                                        .addComponent(idReclammation,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE, 135,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addGroup(reclammationTransferPanelLayout
                                                                .createSequentialGroup().addComponent(valideRBtn)
                                                                .addPreferredGap(
                                                                        javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                                .addComponent(invalidRBtn)))
                                                .addGap(147, 147, 147))
                                .addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
                                        reclammationTransferPanelLayout.createSequentialGroup()
                                                .addComponent(transferRecBtn).addContainerGap())
                                .addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
                                        reclammationTransferPanelLayout.createSequentialGroup()
                                                .addComponent(jLabel5).addGap(88, 88, 88)))));
        reclammationTransferPanelLayout.setVerticalGroup(reclammationTransferPanelLayout
                .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(reclammationTransferPanelLayout.createSequentialGroup().addGap(6, 6, 6)
                        .addComponent(jLabel5).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(reclammationTransferPanelLayout
                                .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(idReclammation, javax.swing.GroupLayout.PREFERRED_SIZE,
                                        javax.swing.GroupLayout.DEFAULT_SIZE,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(jLabel2))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(reclammationTransferPanelLayout
                                .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(valideRBtn).addComponent(invalidRBtn))
                        .addGap(18, 18, 18).addComponent(transferRecBtn).addContainerGap(30, Short.MAX_VALUE)));

        ViewRecBtn.setText("Voir");

        jLabel6.setText("ID Reclammation");

        deleteRecBtn.setText("Supprimer");

        javax.swing.GroupLayout recPanelLayout = new javax.swing.GroupLayout(recPanel);
        recPanel.setLayout(recPanelLayout);
        recPanelLayout.setHorizontalGroup(recPanelLayout
                .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(recPanelLayout.createSequentialGroup().addContainerGap().addGroup(recPanelLayout
                        .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent(jScrollPane4)
                        .addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
                                recPanelLayout.createSequentialGroup().addGroup(recPanelLayout
                                        .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                        .addComponent(ListRecBtn)
                                        .addGroup(recPanelLayout.createSequentialGroup().addComponent(ViewRecBtn)
                                                .addGap(18, 18, 18).addComponent(deleteRecBtn))
                                        .addComponent(jLabel6).addComponent(reclammationIDViewField))
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 185,
                                                Short.MAX_VALUE)
                                        .addComponent(reclammationTransferPanel,
                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                javax.swing.GroupLayout.PREFERRED_SIZE)))
                        .addContainerGap()));
        recPanelLayout.setVerticalGroup(recPanelLayout
                .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(recPanelLayout.createSequentialGroup().addContainerGap()
                        .addComponent(jScrollPane4, javax.swing.GroupLayout.PREFERRED_SIZE, 250,
                                javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(recPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addGroup(recPanelLayout.createSequentialGroup().addComponent(ListRecBtn)
                                        .addGap(36, 36, 36).addComponent(jLabel6)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(reclammationIDViewField,
                                                javax.swing.GroupLayout.PREFERRED_SIZE, 28,
                                                javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                        .addGroup(recPanelLayout
                                                .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                                .addComponent(ViewRecBtn).addComponent(deleteRecBtn)))
                                .addComponent(reclammationTransferPanel, javax.swing.GroupLayout.PREFERRED_SIZE,
                                        javax.swing.GroupLayout.DEFAULT_SIZE,
                                        javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addContainerGap(162, Short.MAX_VALUE)));

        reclammationsPane.addTab("Gestion des Reclammations", recPanel);

        mainPane.addTab("Reclammations", reclammationsPane);

        jTextArea3.setColumns(20);
        jTextArea3.setRows(5);
        jScrollPane5.setViewportView(jTextArea3);

        jButton1.setText("Lancer Deliberation");

        jButton2.setText("Modify");
        jButton2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton2ActionPerformed(evt);
            }
        });

        jButton3.setText("supprimer");

        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)
                        .addComponent(jScrollPane5, javax.swing.GroupLayout.DEFAULT_SIZE, 720, Short.MAX_VALUE)
                        .addGroup(jPanel4Layout.createSequentialGroup().addComponent(jButton1).addGap(37, 37, 37)
                                .addComponent(jButton2, javax.swing.GroupLayout.PREFERRED_SIZE, 111,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(32, 32, 32)
                                .addComponent(jButton3, javax.swing.GroupLayout.PREFERRED_SIZE, 126,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(0, 0, Short.MAX_VALUE)))
                        .addContainerGap()));
        jPanel4Layout.setVerticalGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel4Layout.createSequentialGroup().addContainerGap()
                        .addComponent(jScrollPane5, javax.swing.GroupLayout.PREFERRED_SIZE, 247,
                                javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(jButton1).addComponent(jButton2).addComponent(jButton3))
                        .addContainerGap(292, Short.MAX_VALUE)));

        deliberationPane.addTab("Gestion des Deliberations", jPanel4);

        mainPane.addTab("Deliberations", deliberationPane);

        jTextArea4.setColumns(20);
        jTextArea4.setRows(5);
        jScrollPane6.setViewportView(jTextArea4);

        jButton4.setText("Enseignants");

        jPanel7.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Ajouter _Supprimer Jurer",
                javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION,
                javax.swing.border.TitledBorder.DEFAULT_POSITION, null, java.awt.Color.orange));

        jLabel3.setText("ID Enseignant :");

        jButton5.setText("Ajouter");

        jButton6.setText("Supprimer");

        javax.swing.GroupLayout jPanel7Layout = new javax.swing.GroupLayout(jPanel7);
        jPanel7.setLayout(jPanel7Layout);
        jPanel7Layout.setHorizontalGroup(jPanel7Layout
                .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel7Layout.createSequentialGroup().addContainerGap().addComponent(jLabel3)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 148,
                                javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addContainerGap(115, Short.MAX_VALUE))
                .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel7Layout.createSequentialGroup()
                        .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(jButton6).addGap(26, 26, 26).addComponent(jButton5).addContainerGap()));
        jPanel7Layout.setVerticalGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel7Layout.createSequentialGroup().addContainerGap().addGroup(jPanel7Layout
                        .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE).addComponent(jLabel3)
                        .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(jButton5).addComponent(jButton6))
                        .addContainerGap(20, Short.MAX_VALUE)));

        jButton7.setText("List Jurers");

        javax.swing.GroupLayout jPanel6Layout = new javax.swing.GroupLayout(jPanel6);
        jPanel6.setLayout(jPanel6Layout);
        jPanel6Layout
                .setHorizontalGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(jPanel6Layout.createSequentialGroup().addContainerGap().addGroup(jPanel6Layout
                                .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                .addComponent(jScrollPane6, javax.swing.GroupLayout.PREFERRED_SIZE, 704,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGroup(jPanel6Layout.createSequentialGroup()
                                        .addGroup(jPanel6Layout
                                                .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                .addComponent(jButton4).addComponent(jButton7))
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED,
                                                javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                        .addComponent(jPanel7, javax.swing.GroupLayout.PREFERRED_SIZE,
                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                javax.swing.GroupLayout.PREFERRED_SIZE)))
                                .addContainerGap(28, Short.MAX_VALUE)));
        jPanel6Layout.setVerticalGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel6Layout.createSequentialGroup().addContainerGap()
                        .addComponent(jScrollPane6, javax.swing.GroupLayout.PREFERRED_SIZE, 235,
                                javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addComponent(jPanel7, javax.swing.GroupLayout.PREFERRED_SIZE,
                                        javax.swing.GroupLayout.DEFAULT_SIZE,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGroup(jPanel6Layout.createSequentialGroup().addGap(29, 29, 29)
                                        .addComponent(jButton4).addGap(18, 18, 18).addComponent(jButton7)))
                        .addContainerGap(220, Short.MAX_VALUE)));

        jTabbedPane2.addTab("Gestion de Jury", jPanel6);

        mainPane.addTab("Gerer le Jury", jTabbedPane2);

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.ipadx = 18;
        gridBagConstraints.ipady = 47;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
        gridBagConstraints.insets = new java.awt.Insets(53, 22, 5, 0);
        add(mainPane, gridBagConstraints);
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 0;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
        add(errorStatusBar, gridBagConstraints);
    }// </editor-fold>//GEN-END:initComponents

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

        //Call the MOdify Panel
        mainF.mainFrame.dispose();
        mainFrame = new mainF();
        mainFrame.launchFrame(new ModifyProfile(userObject), mainFrame);
    }//GEN-LAST:event_modifyBtnActionPerformed

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

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

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

        mainFrame = new mainF();
        mainFrame.launchFrame(new Authentification(), mainFrame);

    }//GEN-LAST:event_logoutBtnActionPerformed

    private void submitThemeBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_submitThemeBtnActionPerformed
        // TODO add your handling code here:
        String id_theme = idFieldThemeDelete.getText();
        String title = themeTitleField.getText();
        String desp = themeDescripArea.getText();

        if (modify == false) {
            //Add theme
            if (title.equals("") || title == null) {
                JOptionPane.showMessageDialog(mainFrame, "Title cannot be Empty !");
                return;
            }

            if (desp.equals("") || desp == null) {
                JOptionPane.showMessageDialog(mainFrame, "Description cannot be Empty !");
                return;
            }

            //All fields are correct ; Add theme
            new ThemeThread(title, desp).start();
        } else {
            //modify theme
            if (title.equals("") || title == null) {
                JOptionPane.showMessageDialog(mainFrame, "Title cannot be Empty !");
                return;
            }

            if (desp.equals("") || desp == null) {
                JOptionPane.showMessageDialog(mainFrame, "Description cannot be Empty !");
                return;
            }

            new ThemeThread(title, desp, id_theme).start();
        }
    }//GEN-LAST:event_submitThemeBtnActionPerformed

    private void listThemeBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_listThemeBtnActionPerformed
        // TODO add your handling code here:
        new ThemeThread(4).start();
    }//GEN-LAST:event_listThemeBtnActionPerformed

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

        String idF = idFieldThemeDelete.getText();
        if (idF.equals("")) {
            JOptionPane.showMessageDialog(mainFrame, "ID cannot be Empty");
            return;
        }
        //Test for NumberFormat
        int id = -1;

        try {
            id = Integer.parseInt(idF);
        } catch (NumberFormatException e) {
            JOptionPane.showMessageDialog(mainFrame, "ID cannot contain Letters");
        }
        //JOptionPane.showMessageDialog(mainFrame, "ID cannot be Empty");

        new ThemeThread(id).start();

    }//GEN-LAST:event_deleteThemeBtnActionPerformed

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

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

        String idF = idFieldThemeDelete.getText();

        if (idF.equals("")) {
            JOptionPane.showMessageDialog(mainFrame, "ID cannot be Empty");
            return;
        } else {
            //Test for NumberFormat
            int id = -1;

            try {
                id = Integer.parseInt(idF);
            } catch (NumberFormatException e) {
                JOptionPane.showMessageDialog(mainFrame, "ID cannot contain Letters");
                return;
            }
            //JOptionPane.showMessageDialog(mainFrame, "ID cannot be Empty");

            activateaAddPanel(true);
            modifyPanelChange();

            modify = true;
        }
        //new ThemeThread(id_theme).start();

    }//GEN-LAST:event_modifyThemeBtnActionPerformed

    public void modifyPanelChange() {
        submitThemeBtn.setText("Modify");
        themeTitleLabel.setText("New Title :");
        descripLabel.setText("New Description :");
    }

    public void addPanelChange() {
        submitThemeBtn.setText("Submit");
        themeTitleLabel.setText("Title :");
        descripLabel.setText("Description :");
    }

    private void cancelThemeBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cancelThemeBtnActionPerformed
        // TODO add your handling code here:
        activateaAddPanel(false);
    }//GEN-LAST:event_cancelThemeBtnActionPerformed

    private void addThemeBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addThemeBtnActionPerformed
        // TODO add your handling code here:
        activateaAddPanel(true);
        addPanelChange();
        modify = false;
    }//GEN-LAST:event_addThemeBtnActionPerformed

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

    public void activateaAddPanel(boolean bool) {
        themeDescripArea.setText("");
        themeTitleField.setText("");
        addThemePanel.setEnabled(bool);
        addThemePanel.setVisible(bool);

    }

    public void showThemes(JSONObject jsonObject) {
        // 1. Get Response after Sending Request to Add Theme
        // 2. Access the ThemeWindow = themeMainArea

        JSONObject response = jsonObject;

        if (response == null)
            updateStatus("Error , Null Response in ListThemes");
        //Do we have any themes Stored
        //if(!themeList.isEmpty()){
        Iterator<String> it = response.keys();
        String title = null;
        int id = -1;
        String proposeur = null;
        String type = null;
        JSONObject jobject = null;
        log(null); //Clear Screen
        log("\n ***************** List of Themes  ******************");
        log("\n No \t ID \t Titre   \t \t \t Type  \t \t  Proposeur");
        int i = 1;
        //Iterate through List of themes
        while (it.hasNext()) {
            try {

                jobject = response.getJSONObject(it.next());

                title = jobject.getString("titre");
                proposeur = jobject.getString("email");
                type = jobject.getString("type");
                id = jobject.getInt("id");

                if (title.length() > 10)
                    title = title.substring(0, 10);

                log("\n" + i + "\t " + id + "\t" + title.trim() + "\t \t \t" + type + " \t \t " + proposeur);
                i++;
            } catch (JSONException ex) {
                JOptionPane.showConfirmDialog(mainFrame, "Error Occured");
            }

        } //End of While

    }

    public void showReclammations(JSONObject json) {
        JSONObject response = json;
        //Get reclammation Objects
        Iterator<String> it = response.keys();
        String id = null;
        String studentName = null;
        String studentLastN = null;
        String type = null;

        //clear screen
        log(null);

        //Display Info
        if (response == null)
            JOptionPane.showMessageDialog(mainFrame, "Error in Response");

    }

    public void log(Object message) {
        if (message == null) {
            themeMainArea.setText("");
        } else {
            themeMainArea.append((String) message);
        }
    }

    /**
     * Theme management thread
     */
    private class ThemeThread extends Thread {
        private String title;
        private String description;
        private final int ADD_THEME = 0;
        private final int MODIFY_THEME = 1;
        private final int DELETE_THEME = 2;
        private final int LIST_THEME = 4;
        private int action = -1;
        private final int TYPE_USER = 4;
        private String emailUser = null;
        private String id_theme = null;

        public ThemeThread(String title, String description) {
            this.title = title;
            this.description = description;
            action = 0;

        }

        public ThemeThread(String title, String description, int action) {
            this.title = title;
            this.description = description;
            this.action = action;
        }

        public ThemeThread(String title, String description, String id_theme) {
            this.title = title;
            this.description = description;
            this.action = MODIFY_THEME;
            this.id_theme = id_theme;
        }

        public ThemeThread(int action) {//For listing themes
            this(null, null, action);
        }

        public ThemeThread(String id_theme) { //For delete Theme
            this.id_theme = id_theme;
            this.action = DELETE_THEME;
        }

        /**
         * Propose an Internship theme
         */
        public void addTheme() {

            try {
                emailUser = userObject.getString("email");
            } catch (JSONException ex) {
                ex.printStackTrace();
            }
            // Send Request to add theme to Database
            JSONObject response = Util.addTheme(title, description, emailUser, TYPE_USER);

            try {
                if (response.getInt("response code") == 1) {
                    //Display Response on Screen
                    log(null);
                    log(response.getString("response message"));
                } else {
                    ResponsableInterface.updateStatus(response.getString("response message"));
                }
            } catch (JSONException ex) {
                ResponsableInterface.updateStatus("Error occured : " + ex.getMessage());
            }

            // Update theme list on Local System
            //storeThemes(Util.listThemes()); Error occucured here

        }

        //List themes
        public void listThemes() {
            //COde here :
            try {
                emailUser = userObject.getString("email");
            } catch (JSONException ex) {
                ex.printStackTrace();
            }
            //
            showThemes(Util.listThemes());
            //storeThemes(Util.listThemes());

        }

        //Delete Theme
        public void deleteTheme() {
            //Validate Number / ID Entered 
            if (id_theme.equals("") || id_theme == null)
                JOptionPane.showConfirmDialog(mainFrame, "ID Field is Empty ! ");
            else {

                JSONObject response = Util.deleteTheme(id_theme, TYPE_USER);
                try {
                    if (response.getInt("response code") == 1) {
                        //Display Response on Screen
                        log(null);
                        log(response.getString("response message"));
                    } else {
                        ResponsableInterface.updateStatus(response.getString("response message"));
                    }
                } catch (JSONException ex) {
                    ResponsableInterface.updateStatus("Error occured : " + ex.getMessage());
                }
            }

        }

        public void modifyTheme() {
            //Verify Fields

            // Send Request to add theme to Database
            try {

                JSONObject response = Util.modifyTheme(title, description, TYPE_USER, id_theme);
                if (response.getInt("response code") == 1) {
                    //Display Response on Screen
                    log(null);
                    log(response.getString("response message"));
                } else {
                    ResponsableInterface.updateStatus(response.getString("response message"));
                }
            } catch (JSONException ex) {
                ResponsableInterface.updateStatus("Error occured : " + ex.getMessage());
            }

        }

        @Override
        public void run() {

            switch (action) {
            case ADD_THEME:
                addTheme();
                break;

            case DELETE_THEME:
                deleteTheme();
                break;

            case MODIFY_THEME:
                modifyTheme();
                break;

            case LIST_THEME:
                listThemes();
                break;

            default:
                listThemes();
                break;

            }
        }

    }//ENd of thread

    private class RecThread extends Thread {
        private String idRec = null;
        private int action = -1;
        private final int listREC = 1;
        private final int viewREC = 2;
        private final int transferRec = 3;

        //Construtor to List things 
        public RecThread(String idRec) {
            this.idRec = idRec;
        }

        //List the reclammations
        public void listRec() {

        }

        //view a reclammation
        public void viewRec() {

        }

        //transfer a reclammation 
        public void transferRec() {

        }

        @Override
        public void run() {

            switch (action) {
            case listREC:
                listRec();
                break;

            case viewREC:
                viewRec();
                break;

            case transferRec:
                transferRec();
                break;
            default:
                break;

            }
        }

    }//End of Thread

    private boolean modify = false;
    private static mainF mainFrame = null;
    private JSONObject userObject = null;
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton ListRecBtn;
    private javax.swing.JButton ViewRecBtn;
    private javax.swing.JButton addThemeBtn;
    private javax.swing.JPanel addThemePanel;
    private javax.swing.JLabel addressLabel;
    private javax.swing.JButton cancelThemeBtn;
    private javax.swing.JButton deleteRecBtn;
    private javax.swing.JButton deleteThemeBtn;
    private javax.swing.JTabbedPane deliberationPane;
    private javax.swing.JLabel descripLabel;
    private javax.swing.JLabel emailLabel;
    private static javax.swing.JLabel errorStatusBar;
    private javax.swing.JTextField idFieldThemeDelete;
    private javax.swing.JTextField idReclammation;
    private javax.swing.JLabel idThemeLabel;
    private javax.swing.JRadioButton invalidRBtn;
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton2;
    private javax.swing.JButton jButton3;
    private javax.swing.JButton jButton4;
    private javax.swing.JButton jButton5;
    private javax.swing.JButton jButton6;
    private javax.swing.JButton jButton7;
    private javax.swing.JButton jButton8;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    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.JPanel jPanel7;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JScrollPane jScrollPane3;
    private javax.swing.JScrollPane jScrollPane4;
    private javax.swing.JScrollPane jScrollPane5;
    private javax.swing.JScrollPane jScrollPane6;
    private javax.swing.JSeparator jSeparator1;
    private javax.swing.JSeparator jSeparator2;
    private javax.swing.JTabbedPane jTabbedPane1;
    private javax.swing.JTabbedPane jTabbedPane2;
    private javax.swing.JTextArea jTextArea1;
    private javax.swing.JTextArea jTextArea2;
    private javax.swing.JTextArea jTextArea3;
    private javax.swing.JTextArea jTextArea4;
    private javax.swing.JTextField jTextField1;
    private javax.swing.JButton listStudents;
    private javax.swing.JButton listThemeBtn;
    private javax.swing.JButton logoutBtn;
    private javax.swing.JTabbedPane mainPane;
    private javax.swing.JButton modifyBtn;
    private javax.swing.JButton modifyThemeBtn;
    private javax.swing.JLabel nameLabel;
    private javax.swing.JLabel photoLabel;
    private javax.swing.ButtonGroup recBtnGroup;
    private javax.swing.JPanel recPanel;
    private javax.swing.JTextField reclammationIDViewField;
    private javax.swing.JPanel reclammationTransferPanel;
    private javax.swing.JTabbedPane reclammationsPane;
    private javax.swing.JButton searchBtn;
    private javax.swing.JTextField searchField;
    private javax.swing.JButton submitThemeBtn;
    private javax.swing.JLabel telLabel;
    private javax.swing.JTextArea themeDescripArea;
    private javax.swing.JTextArea themeMainArea;
    private javax.swing.JTextField themeTitleField;
    private javax.swing.JLabel themeTitleLabel;
    private javax.swing.JTabbedPane themesTabPane;
    private javax.swing.JButton transferRecBtn;
    private javax.swing.JRadioButton valideRBtn;
    // End of variables declaration//GEN-END:variables
}