GUI.DashbordAdminFrame.java Source code

Java tutorial

Introduction

Here is the source code for GUI.DashbordAdminFrame.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 GUI;

import com.restfb.DefaultFacebookClient;
import com.restfb.FacebookClient;
import com.restfb.Parameter;
import com.restfb.types.FacebookType;
import com.restfb.types.Page;
import com.teamdev.jxbrowser.chromium.Browser;
import com.teamdev.jxbrowser.chromium.swing.BrowserView;
import dao.CommentDao;
import dao.ProduitDao;
import dao.ReclamationDao;
import dao.ServiceDao;
import dao.UserDao;
import de.javasoft.plaf.synthetica.SyntheticaBlueLightLookAndFeel;
import entite.Comment;
import entite.Produit;
import entite.Reclamation;
import entite.Service;
import entite.User;
import entite.Zone;
import java.awt.BorderLayout;
import java.time.LocalDate;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Properties;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.mail.Message;
import javax.mail.MessagingException;
import javax.mail.PasswordAuthentication;
import javax.mail.Session;
import javax.mail.Transport;
import javax.mail.internet.InternetAddress;
import javax.mail.internet.MimeMessage;
import javax.swing.JOptionPane;
import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;
import javax.swing.table.TableModel;
import org.apache.http.ParseException;
import utils.CommentDPModel;
import utils.CommentDSModel;
import utils.CommentSModel;
import utils.ListeService;
import utils.ProduitModel;
import utils.ReclamationModel;

/**
 *
 * @author Lilya Thebti
 */
public class DashbordAdminFrame extends javax.swing.JFrame {

    private static int service_id;
    private static int produit_id;

    ServiceDao sdao = new ServiceDao();
    ProduitDao pdao = new ProduitDao();
    // Browser browser = new Browser();
    //BrowserView view = new BrowserView(browser);

    public static int getService_id() {
        return service_id;
    }

    public static void setService_id(int service_id) {
        DashbordAdminFrame.service_id = service_id;
    }

    public static int getProduit_id() {
        return produit_id;
    }

    public static void setProduit_id(int produit_id) {
        DashbordAdminFrame.produit_id = produit_id;
    }

    /**
     * Creates new form DashbordAdminFrame
     */
    public DashbordAdminFrame() throws UnsupportedLookAndFeelException, ParseException, java.text.ParseException {
        UIManager.setLookAndFeel(new SyntheticaBlueLightLookAndFeel());
        initComponents();
    }

    /**
     * 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() {

        jPanel1 = new javax.swing.JPanel();
        HeadPanel = new javax.swing.JPanel();
        menu = new javax.swing.JPanel();
        btnGUser = new javax.swing.JButton();
        btnGProduits = new javax.swing.JButton();
        btnGService = new javax.swing.JButton();
        btnMail = new javax.swing.JButton();
        btnStatistique = new javax.swing.JButton();
        btnReclam = new javax.swing.JButton();
        btnPanier = new javax.swing.JButton();
        ContentPanel = new javax.swing.JPanel();
        statistiquePanel = new javax.swing.JPanel();
        jPanel5 = new javax.swing.JPanel();
        jPanel6 = new javax.swing.JPanel();
        jPanel7 = new javax.swing.JPanel();
        jLabel11 = new javax.swing.JLabel();
        produitPanel = new javax.swing.JPanel();
        OffresProduitsTableauPanel = new javax.swing.JPanel();
        jScrollPane3 = new javax.swing.JScrollPane();
        tbProduits = new javax.swing.JTable();
        btnPartager = new javax.swing.JButton();
        btnConsulterProduit = new javax.swing.JButton();
        ConsultationPanel = new javax.swing.JPanel();
        lNomProduit = new javax.swing.JLabel();
        lCategorie = new javax.swing.JLabel();
        lQuantite = new javax.swing.JLabel();
        lDescription = new javax.swing.JLabel();
        lPrix = new javax.swing.JLabel();
        lPointBonus = new javax.swing.JLabel();
        lZone = new javax.swing.JLabel();
        lTVA = new javax.swing.JLabel();
        lReduction = new javax.swing.JLabel();
        btnBackP = new javax.swing.JButton();
        jScrollPane4 = new javax.swing.JScrollPane();
        tbCommProd = new javax.swing.JTable();
        ServicePanel = new javax.swing.JPanel();
        pAllServices = new javax.swing.JPanel();
        jScrollPane7 = new javax.swing.JScrollPane();
        tblAllServices = new javax.swing.JTable();
        btnConsulterS1 = new javax.swing.JButton();
        bntSupprimer = new javax.swing.JButton();
        pConsulterS2 = new javax.swing.JPanel();
        btnBackS2 = new javax.swing.JButton();
        jScrollPane5 = new javax.swing.JScrollPane();
        tbCommentairesService = new javax.swing.JTable();
        btnSupprimerCommentaire = new javax.swing.JButton();
        bntMap = new javax.swing.JButton();
        pDetailS = new javax.swing.JPanel();
        jLabel26 = new javax.swing.JLabel();
        lNomSAll = new javax.swing.JLabel();
        lDescriptionSAll = new javax.swing.JLabel();
        jLabel27 = new javax.swing.JLabel();
        jLabel28 = new javax.swing.JLabel();
        lCategorieServiceAll = new javax.swing.JLabel();
        lEtatSAll = new javax.swing.JLabel();
        jLabel29 = new javax.swing.JLabel();
        jLabel30 = new javax.swing.JLabel();
        lZoneSAll = new javax.swing.JLabel();
        pShowMap = new javax.swing.JPanel();
        tfComment = new javax.swing.JTextField();
        btnCommenter1 = new javax.swing.JButton();
        pShowMap1 = new javax.swing.JPanel();
        jLabel56 = new javax.swing.JLabel();
        MailPanel = new javax.swing.JPanel();
        tfObjet = new javax.swing.JTextField();
        jScrollPane1 = new javax.swing.JScrollPane();
        taContenu = new javax.swing.JTextArea();
        btnEnvMail = new javax.swing.JButton();
        ReclamPanel = new javax.swing.JPanel();
        jScrollPane2 = new javax.swing.JScrollPane();
        tbReclam = new javax.swing.JTable();
        btnSupprimerReclam = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        javax.swing.GroupLayout HeadPanelLayout = new javax.swing.GroupLayout(HeadPanel);
        HeadPanel.setLayout(HeadPanelLayout);
        HeadPanelLayout.setHorizontalGroup(HeadPanelLayout
                .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 0, Short.MAX_VALUE));
        HeadPanelLayout.setVerticalGroup(HeadPanelLayout
                .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 57, Short.MAX_VALUE));

        btnGUser.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/user.png"))); // NOI18N
        btnGUser.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnGUserActionPerformed(evt);
            }
        });

        btnGProduits.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/store.png"))); // NOI18N
        btnGProduits.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnGProduitsActionPerformed(evt);
            }
        });

        btnGService.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/tools.png"))); // NOI18N
        btnGService.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnGServiceActionPerformed(evt);
            }
        });

        btnMail.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/mail.png"))); // NOI18N
        btnMail.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnMailActionPerformed(evt);
            }
        });

        btnStatistique.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/stat.png"))); // NOI18N
        btnStatistique.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnStatistiqueActionPerformed(evt);
            }
        });

        btnReclam.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/reclamation.png"))); // NOI18N
        btnReclam.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnReclamActionPerformed(evt);
            }
        });

        btnPanier.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/panier.png"))); // NOI18N
        btnPanier.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnPanierActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout menuLayout = new javax.swing.GroupLayout(menu);
        menu.setLayout(menuLayout);
        menuLayout.setHorizontalGroup(menuLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(menuLayout.createSequentialGroup().addContainerGap()
                        .addGroup(menuLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                .addComponent(btnStatistique, javax.swing.GroupLayout.DEFAULT_SIZE,
                                        javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addComponent(btnGUser, javax.swing.GroupLayout.DEFAULT_SIZE,
                                        javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addComponent(btnGProduits, javax.swing.GroupLayout.DEFAULT_SIZE,
                                        javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addComponent(btnGService, javax.swing.GroupLayout.DEFAULT_SIZE,
                                        javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addComponent(btnMail, javax.swing.GroupLayout.DEFAULT_SIZE,
                                        javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addComponent(btnReclam, javax.swing.GroupLayout.DEFAULT_SIZE,
                                        javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addComponent(btnPanier, javax.swing.GroupLayout.DEFAULT_SIZE,
                                        javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                        .addContainerGap(26, Short.MAX_VALUE)));
        menuLayout.setVerticalGroup(menuLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(menuLayout.createSequentialGroup().addContainerGap()
                        .addComponent(btnGUser, javax.swing.GroupLayout.PREFERRED_SIZE, 55,
                                javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(btnGProduits, javax.swing.GroupLayout.PREFERRED_SIZE, 55,
                                javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(btnGService, javax.swing.GroupLayout.PREFERRED_SIZE, 55,
                                javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(btnMail, javax.swing.GroupLayout.PREFERRED_SIZE, 55,
                                javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(btnStatistique, javax.swing.GroupLayout.PREFERRED_SIZE, 55,
                                javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(btnReclam, javax.swing.GroupLayout.PREFERRED_SIZE, 55,
                                javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(btnPanier, javax.swing.GroupLayout.PREFERRED_SIZE, 55,
                                javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));

        ContentPanel.setLayout(new java.awt.CardLayout());

        statistiquePanel.setLayout(null);

        jPanel5.setLayout(new java.awt.BorderLayout());
        statistiquePanel.add(jPanel5);
        jPanel5.setBounds(10, 0, 540, 280);

        jPanel6.setLayout(new java.awt.BorderLayout());
        statistiquePanel.add(jPanel6);
        jPanel6.setBounds(600, 0, 570, 280);

        jPanel7.setLayout(new java.awt.BorderLayout());
        statistiquePanel.add(jPanel7);
        jPanel7.setBounds(20, 290, 530, 220);

        jLabel11.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/bg.jpg"))); // NOI18N
        statistiquePanel.add(jLabel11);
        jLabel11.setBounds(0, 0, 1180, 520);

        ContentPanel.add(statistiquePanel, "card3");

        produitPanel.setLayout(new java.awt.CardLayout());

        jScrollPane3.setSize(500, 600);

        tbProduits.setSize(600, 600);
        tbProduits.setModel(new ProduitModel());
        tbProduits.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                tbProduitsMouseClicked(evt);
            }
        });
        jScrollPane3.setViewportView(tbProduits);

        btnPartager.setText("Partager");
        btnPartager.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnPartagerActionPerformed(evt);
            }
        });

        btnConsulterProduit.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/forward.png"))); // NOI18N
        btnConsulterProduit.setText("Consulter");
        btnConsulterProduit.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                btnConsulterProduitMouseClicked(evt);
            }
        });
        btnConsulterProduit.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnConsulterProduitActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout OffresProduitsTableauPanelLayout = new javax.swing.GroupLayout(
                OffresProduitsTableauPanel);
        OffresProduitsTableauPanel.setLayout(OffresProduitsTableauPanelLayout);
        OffresProduitsTableauPanelLayout.setHorizontalGroup(OffresProduitsTableauPanelLayout
                .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(OffresProduitsTableauPanelLayout.createSequentialGroup()
                        .addGroup(OffresProduitsTableauPanelLayout
                                .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addGroup(OffresProduitsTableauPanelLayout.createSequentialGroup()
                                        .addGap(63, 63, 63)
                                        .addComponent(btnConsulterProduit, javax.swing.GroupLayout.PREFERRED_SIZE,
                                                180, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addGap(282, 282, 282).addComponent(btnPartager))
                                .addGroup(
                                        OffresProduitsTableauPanelLayout.createSequentialGroup().addGap(51, 51, 51)
                                                .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE,
                                                        777, javax.swing.GroupLayout.PREFERRED_SIZE)))
                        .addContainerGap(402, Short.MAX_VALUE)));
        OffresProduitsTableauPanelLayout.setVerticalGroup(
                OffresProduitsTableauPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(OffresProduitsTableauPanelLayout.createSequentialGroup().addGap(39, 39, 39)
                                .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 297,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(69, 69, 69)
                                .addGroup(OffresProduitsTableauPanelLayout
                                        .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addComponent(btnConsulterProduit).addComponent(btnPartager,
                                                javax.swing.GroupLayout.PREFERRED_SIZE, 32,
                                                javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addContainerGap(153, Short.MAX_VALUE)));

        produitPanel.add(OffresProduitsTableauPanel, "card2");

        lNomProduit.setText("jLabel10");

        lCategorie.setText("jLabel11");

        lQuantite.setText("jLabel12");

        lDescription.setText("jLabel13");

        lPrix.setText("jLabel14");

        lPointBonus.setText("jLabel15");

        lZone.setText("jLabel16");

        lTVA.setText("jLabel17");

        lReduction.setText("jLabel10");

        btnBackP.setText("Back");
        btnBackP.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnBackPActionPerformed(evt);
            }
        });

        tbCommProd.setModel(new CommentDPModel());
        jScrollPane4.setViewportView(tbCommProd);

        javax.swing.GroupLayout ConsultationPanelLayout = new javax.swing.GroupLayout(ConsultationPanel);
        ConsultationPanel.setLayout(ConsultationPanelLayout);
        ConsultationPanelLayout.setHorizontalGroup(ConsultationPanelLayout
                .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(ConsultationPanelLayout.createSequentialGroup().addGap(211, 211, 211)
                        .addGroup(ConsultationPanelLayout
                                .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                .addComponent(btnBackP).addComponent(lReduction).addComponent(lTVA)
                                .addComponent(lZone).addComponent(lPointBonus).addComponent(lPrix)
                                .addComponent(lDescription).addComponent(lQuantite).addComponent(lCategorie)
                                .addComponent(lNomProduit))
                        .addGap(44, 44, 44)
                        .addComponent(jScrollPane4, javax.swing.GroupLayout.PREFERRED_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addContainerGap(468, Short.MAX_VALUE)));
        ConsultationPanelLayout.setVerticalGroup(ConsultationPanelLayout
                .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(ConsultationPanelLayout.createSequentialGroup().addGroup(ConsultationPanelLayout
                        .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(ConsultationPanelLayout.createSequentialGroup().addGap(46, 46, 46)
                                .addComponent(lNomProduit)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(lCategorie).addGap(18, 18, 18).addComponent(lQuantite)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(lDescription).addGap(18, 18, 18).addComponent(lPrix)
                                .addGap(18, 18, 18).addComponent(lPointBonus).addGap(18, 18, 18).addComponent(lZone)
                                .addGap(18, 18, 18).addComponent(lTVA)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(lReduction).addGap(47, 47, 47).addComponent(btnBackP))
                        .addGroup(ConsultationPanelLayout.createSequentialGroup().addContainerGap().addComponent(
                                jScrollPane4, javax.swing.GroupLayout.PREFERRED_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                        .addContainerGap(186, Short.MAX_VALUE)));

        produitPanel.add(ConsultationPanel, "card3");

        ContentPanel.add(produitPanel, "card4");

        ServicePanel.setLayout(new java.awt.CardLayout());

        pAllServices.setLayout(null);

        tblAllServices.setModel((new ListeService()));
        tblAllServices.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                tblAllServicesMouseClicked(evt);
            }
        });
        jScrollPane7.setViewportView(tblAllServices);

        pAllServices.add(jScrollPane7);
        jScrollPane7.setBounds(55, 11, 452, 402);

        btnConsulterS1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/forward.png"))); // NOI18N
        btnConsulterS1.setText("Consulter");
        btnConsulterS1.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                btnConsulterS1MouseClicked(evt);
            }
        });
        btnConsulterS1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnConsulterS1ActionPerformed(evt);
            }
        });
        pAllServices.add(btnConsulterS1);
        btnConsulterS1.setBounds(50, 450, 180, 41);

        bntSupprimer.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/rubbish-bin.png"))); // NOI18N
        bntSupprimer.setText("Supprimer");
        bntSupprimer.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                bntSupprimerActionPerformed(evt);
            }
        });
        pAllServices.add(bntSupprimer);
        bntSupprimer.setBounds(250, 450, 180, 40);

        ServicePanel.add(pAllServices, "card3");

        btnBackS2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/back.png"))); // NOI18N
        btnBackS2.setText("Back");
        btnBackS2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnBackS2ActionPerformed(evt);
            }
        });

        tbCommentairesService.setModel(new CommentDSModel());
        tbCommentairesService.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                tbCommentairesServiceMouseClicked(evt);
            }
        });
        jScrollPane5.setViewportView(tbCommentairesService);

        btnSupprimerCommentaire
                .setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/rubbish-bin.png"))); // NOI18N
        btnSupprimerCommentaire.setText("Supprimer Commentaire");
        btnSupprimerCommentaire.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnSupprimerCommentaireActionPerformed(evt);
            }
        });

        bntMap.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/map-2.png"))); // NOI18N
        bntMap.setText("voir maps");
        bntMap.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                bntMapActionPerformed(evt);
            }
        });

        pDetailS.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED,
                new java.awt.Color(0, 153, 255), new java.awt.Color(0, 153, 255), new java.awt.Color(0, 153, 255),
                new java.awt.Color(0, 153, 255)));

        jLabel26.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        jLabel26.setText("Nom Service :");

        lNomSAll.setText("nom");

        lDescriptionSAll.setText("des");

        jLabel27.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        jLabel27.setText("Description :");

        jLabel28.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        jLabel28.setText("Catgorie :");

        lCategorieServiceAll.setText("cat");

        lEtatSAll.setText("etat");

        jLabel29.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        jLabel29.setText("Etat :");

        jLabel30.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        jLabel30.setText("Zone :");

        lZoneSAll.setText("zone");

        javax.swing.GroupLayout pDetailSLayout = new javax.swing.GroupLayout(pDetailS);
        pDetailS.setLayout(pDetailSLayout);
        pDetailSLayout.setHorizontalGroup(pDetailSLayout
                .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(pDetailSLayout.createSequentialGroup().addGap(42, 42, 42).addGroup(pDetailSLayout
                        .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(pDetailSLayout.createSequentialGroup().addComponent(jLabel27).addGap(18, 18, 18)
                                .addComponent(lDescriptionSAll))
                        .addGroup(pDetailSLayout.createSequentialGroup().addComponent(jLabel26)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(lNomSAll))
                        .addGroup(pDetailSLayout.createSequentialGroup().addGap(6, 6, 6)
                                .addGroup(pDetailSLayout
                                        .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addComponent(jLabel28).addComponent(jLabel29).addComponent(jLabel30))
                                .addGap(18, 18, 18)
                                .addGroup(pDetailSLayout
                                        .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addComponent(lZoneSAll).addComponent(lEtatSAll)
                                        .addComponent(lCategorieServiceAll))))
                        .addContainerGap(68, Short.MAX_VALUE)));
        pDetailSLayout.setVerticalGroup(pDetailSLayout
                .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(pDetailSLayout.createSequentialGroup().addContainerGap()
                        .addGroup(pDetailSLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(jLabel26).addComponent(lNomSAll))
                        .addGap(26, 26, 26)
                        .addGroup(pDetailSLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(jLabel27).addComponent(lDescriptionSAll))
                        .addGap(30, 30, 30)
                        .addGroup(pDetailSLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(jLabel28).addComponent(lCategorieServiceAll))
                        .addGap(28, 28, 28)
                        .addGroup(pDetailSLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(jLabel29).addComponent(lEtatSAll))
                        .addGap(18, 18, 18)
                        .addGroup(pDetailSLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(jLabel30).addComponent(lZoneSAll))
                        .addContainerGap(84, Short.MAX_VALUE)));

        pShowMap.setLayout(new java.awt.BorderLayout());

        btnCommenter1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/comment_1.png"))); // NOI18N
        btnCommenter1.setText("Commenter");
        btnCommenter1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnCommenter1ActionPerformed(evt);
            }
        });

        pConsulterS2.add(jScrollPane5);
        jScrollPane5.setBounds(55, 11, 452, 402);

        javax.swing.GroupLayout pConsulterS2Layout = new javax.swing.GroupLayout(pConsulterS2);
        pConsulterS2.setLayout(pConsulterS2Layout);
        pConsulterS2Layout.setHorizontalGroup(pConsulterS2Layout
                .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, pConsulterS2Layout.createSequentialGroup()
                        .addGroup(pConsulterS2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addGroup(pConsulterS2Layout.createSequentialGroup().addContainerGap().addComponent(
                                        pDetailS, javax.swing.GroupLayout.PREFERRED_SIZE,
                                        javax.swing.GroupLayout.DEFAULT_SIZE,
                                        javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGroup(pConsulterS2Layout.createSequentialGroup().addGap(18, 18, 18)
                                        .addComponent(btnBackS2).addGap(33, 33, 33).addComponent(bntMap)))
                        .addGroup(pConsulterS2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                .addGroup(pConsulterS2Layout.createSequentialGroup()
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED,
                                                javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                        .addComponent(btnCommenter1, javax.swing.GroupLayout.PREFERRED_SIZE, 131,
                                                javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addGap(18, 18, 18).addComponent(btnSupprimerCommentaire)
                                        .addGap(204, 204, 204))
                                .addGroup(pConsulterS2Layout.createSequentialGroup().addGap(28, 28, 28)
                                        .addComponent(pShowMap, javax.swing.GroupLayout.PREFERRED_SIZE, 430,
                                                javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED,
                                                javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                        .addGroup(pConsulterS2Layout
                                                .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                                .addComponent(tfComment, javax.swing.GroupLayout.PREFERRED_SIZE,
                                                        419, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addComponent(jScrollPane5, javax.swing.GroupLayout.PREFERRED_SIZE,
                                                        480, javax.swing.GroupLayout.PREFERRED_SIZE))
                                        .addGap(31, 31, 31)))));
        pConsulterS2Layout.setVerticalGroup(pConsulterS2Layout
                .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(pConsulterS2Layout.createSequentialGroup().addGroup(pConsulterS2Layout
                        .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(pConsulterS2Layout.createSequentialGroup().addGap(23, 23, 23)
                                .addComponent(pDetailS, javax.swing.GroupLayout.PREFERRED_SIZE,
                                        javax.swing.GroupLayout.DEFAULT_SIZE,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(26, 26, 26)
                                .addGroup(pConsulterS2Layout
                                        .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                        .addComponent(bntMap).addComponent(btnBackS2)))
                        .addGroup(pConsulterS2Layout.createSequentialGroup().addContainerGap()
                                .addGroup(pConsulterS2Layout
                                        .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addComponent(pShowMap, javax.swing.GroupLayout.PREFERRED_SIZE, 339,
                                                javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addGroup(pConsulterS2Layout.createSequentialGroup()
                                                .addComponent(jScrollPane5, javax.swing.GroupLayout.PREFERRED_SIZE,
                                                        286, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addGap(18, 18, 18).addComponent(tfComment,
                                                        javax.swing.GroupLayout.PREFERRED_SIZE, 45,
                                                        javax.swing.GroupLayout.PREFERRED_SIZE)))))
                        .addGap(87, 87, 87)
                        .addGroup(pConsulterS2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addComponent(btnSupprimerCommentaire).addGroup(pConsulterS2Layout
                                        .createSequentialGroup().addGap(26, 26, 26).addComponent(btnCommenter1)))
                        .addContainerGap(84, Short.MAX_VALUE)));

        ServicePanel.add(pConsulterS2, "card3");

        pShowMap1.setLayout(new java.awt.BorderLayout());
        pShowMap1.add(jLabel56, java.awt.BorderLayout.CENTER);

        ServicePanel.add(pShowMap1, "card4");

        ContentPanel.add(ServicePanel, "card5");

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

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

        btnEnvMail.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/Mail_reply.png"))); // NOI18N
        btnEnvMail.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnEnvMailActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout MailPanelLayout = new javax.swing.GroupLayout(MailPanel);
        MailPanel.setLayout(MailPanelLayout);
        MailPanelLayout.setHorizontalGroup(MailPanelLayout
                .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(MailPanelLayout.createSequentialGroup().addGap(135, 135, 135)
                        .addGroup(MailPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                .addComponent(btnEnvMail, javax.swing.GroupLayout.PREFERRED_SIZE, 66,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGroup(MailPanelLayout
                                        .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                        .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 385,
                                                Short.MAX_VALUE)
                                        .addComponent(tfObjet)))
                        .addContainerGap(710, Short.MAX_VALUE)));
        MailPanelLayout.setVerticalGroup(MailPanelLayout
                .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(MailPanelLayout.createSequentialGroup().addGap(39, 39, 39)
                        .addComponent(tfObjet, javax.swing.GroupLayout.PREFERRED_SIZE, 41,
                                javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(30, 30, 30)
                        .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 224,
                                javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(31, 31, 31).addComponent(btnEnvMail, javax.swing.GroupLayout.PREFERRED_SIZE, 36,
                                javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addContainerGap(198, Short.MAX_VALUE)));

        ContentPanel.add(MailPanel, "card5");

        tbReclam.setModel(new ReclamationModel());
        jScrollPane2.setViewportView(tbReclam);

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

        javax.swing.GroupLayout ReclamPanelLayout = new javax.swing.GroupLayout(ReclamPanel);
        ReclamPanel.setLayout(ReclamPanelLayout);
        ReclamPanelLayout.setHorizontalGroup(ReclamPanelLayout
                .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(ReclamPanelLayout.createSequentialGroup().addGroup(ReclamPanelLayout
                        .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(ReclamPanelLayout.createSequentialGroup().addGap(87, 87, 87).addComponent(
                                jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGroup(ReclamPanelLayout.createSequentialGroup().addGap(568, 568, 568)
                                .addComponent(btnSupprimerReclam)))
                        .addContainerGap(581, Short.MAX_VALUE)));
        ReclamPanelLayout.setVerticalGroup(ReclamPanelLayout
                .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(ReclamPanelLayout.createSequentialGroup().addGap(24, 24, 24)
                        .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(9, 9, 9).addComponent(btnSupprimerReclam).addContainerGap(141, Short.MAX_VALUE)));

        ContentPanel.add(ReclamPanel, "card6");

        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)
                        .addGroup(jPanel1Layout.createSequentialGroup()
                                .addComponent(HeadPanel, javax.swing.GroupLayout.DEFAULT_SIZE,
                                        javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addContainerGap())
                        .addGroup(jPanel1Layout.createSequentialGroup()
                                .addComponent(menu, javax.swing.GroupLayout.PREFERRED_SIZE,
                                        javax.swing.GroupLayout.DEFAULT_SIZE,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(18, 18, 18).addComponent(ContentPanel,
                                        javax.swing.GroupLayout.PREFERRED_SIZE, 1230, Short.MAX_VALUE)))));
        jPanel1Layout.setVerticalGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel1Layout.createSequentialGroup().addContainerGap()
                        .addComponent(HeadPanel, javax.swing.GroupLayout.PREFERRED_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addComponent(menu, javax.swing.GroupLayout.DEFAULT_SIZE,
                                        javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addComponent(ContentPanel, javax.swing.GroupLayout.DEFAULT_SIZE,
                                        javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                        .addContainerGap()));

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(layout.createSequentialGroup().addContainerGap().addComponent(jPanel1,
                        javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addContainerGap()));
        layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent(
                jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
                Short.MAX_VALUE));

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

    private void btnGUserActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnGUserActionPerformed
        //       ContentPanel.removeAll();
        //        ContentPanel.add(GestionUtilisateurPanel);
        //        ContentPanel.repaint();
        //        ContentPanel.revalidate();
    }//GEN-LAST:event_btnGUserActionPerformed

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

    private void btnGProduitsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnGProduitsActionPerformed
        ContentPanel.removeAll();
        ContentPanel.add(produitPanel);
        ContentPanel.repaint();
        ContentPanel.revalidate();
    }//GEN-LAST:event_btnGProduitsActionPerformed

    private void btnGServiceActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnGServiceActionPerformed
        ContentPanel.removeAll();
        ContentPanel.add(ServicePanel);
        ContentPanel.repaint();
        ContentPanel.revalidate();
    }//GEN-LAST:event_btnGServiceActionPerformed

    private void btnMailActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnMailActionPerformed
        ContentPanel.removeAll();
        ContentPanel.add(MailPanel);
        ContentPanel.repaint();
        ContentPanel.revalidate();
    }//GEN-LAST:event_btnMailActionPerformed

    private void tblAllServicesMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tblAllServicesMouseClicked
        int i = tblAllServices.getSelectedRow();
        Object l = tblAllServices.getValueAt(i, 0);
        service_id = (int) l;
        System.out.println("ID" + service_id);
    }//GEN-LAST:event_tblAllServicesMouseClicked

    private void btnConsulterS1MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_btnConsulterS1MouseClicked

    }//GEN-LAST:event_btnConsulterS1MouseClicked

    private void btnConsulterS1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnConsulterS1ActionPerformed
        // TODO add your handling code here:
        int i = tblAllServices.getSelectedRow();
        TableModel model = tblAllServices.getModel();
        Object l = tblAllServices.getValueAt(i, 0);
        service_id = (int) l;
        System.out.println(service_id);
        tbCommentairesService.setModel(new CommentSModel());
        tbCommentairesService.setVisible(true);
        lNomSAll.setText(model.getValueAt(i, 1).toString());
        lDescriptionSAll.setText(model.getValueAt(i, 2).toString());
        lCategorieServiceAll.setText(tblAllServices.getValueAt(i, 3).toString());
        lEtatSAll.setText(tblAllServices.getValueAt(i, 4).toString());
        lZoneSAll.setText(model.getValueAt(i, 5).toString());

        Service s = sdao.findById(service_id);

        System.out.println(s.getZone());
        pShowMap.setLayout(new BorderLayout());
        //pShowMap.add(view.getComponent(0), BorderLayout.CENTER);
        java.util.List<Zone> obj = new ArrayList();

        obj = sdao.findByZone(s.getZone());
        double x;
        double y;
        for (Object o : obj) {
            x = ((Zone) o).getLat();
            y = ((Zone) o).getLon();
            System.out.println(x + "dddddddddd" + y);
            //browser.loadURL("https://maps.googleapis.com/maps/api/staticmap?center=" + x + "," + y + "&zoom=12&size=700x500&maptype=roadmap&markers=icone%7Clabel:S%7C" + x + "," + y);
        }
        tbCommentairesService.setModel(new CommentDSModel());
        tbCommentairesService.setVisible(true);
        tbCommentairesService.getColumnModel().getColumn(0).setMinWidth(0);
        tbCommentairesService.getColumnModel().getColumn(0).setMaxWidth(0);
        tbCommentairesService.getColumnModel().getColumn(0).setWidth(0);

        ServicePanel.removeAll();
        ServicePanel.add(pConsulterS2);
        ServicePanel.repaint();
        ServicePanel.revalidate();
    }//GEN-LAST:event_btnConsulterS1ActionPerformed

    private void btnBackS2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnBackS2ActionPerformed
        // TODO add your handling code here:
        ServicePanel.removeAll();
        ServicePanel.add(pAllServices);
        ServicePanel.repaint();
        ServicePanel.revalidate();
    }//GEN-LAST:event_btnBackS2ActionPerformed

    private void tbCommentairesServiceMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tbCommentairesServiceMouseClicked
        // TODO add your handling code here:
    }//GEN-LAST:event_tbCommentairesServiceMouseClicked

    private void btnSupprimerCommentaireActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSupprimerCommentaireActionPerformed
        Comment c = new Comment();
        CommentDao comm = new CommentDao();
        int ligneSelectionne = tbCommentairesService.getSelectedRow();
        Object l = tbCommentairesService.getValueAt(ligneSelectionne, 0);
        System.out.println(l);
        c = comm.findById((int) l);
        String s = (String) tbCommentairesService.getValueAt(ligneSelectionne, 3);
        System.out.println(s);
        //if (FrameAccueil.getUserId() == c.getUser_id()) {
        int i = JOptionPane.showConfirmDialog(null,
                "La suppression est irrversible. tes-vous sr de vouloir continuer?",
                "Veuillez confirmer votre choix", JOptionPane.YES_NO_OPTION);

        if (i == 0) {
            comm.removeById((int) l);
            tbCommentairesService.setModel(new CommentSModel());
        }
        // } else {
        //JOptionPane.showMessageDialog(ParentPanel, "Ce commentaire est ajout par " + s + ". Vous ne pouvez pas le supprimer");
        //}
    }//GEN-LAST:event_btnSupprimerCommentaireActionPerformed

    private void bntMapActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bntMapActionPerformed
        pShowMap.removeAll();
        pShowMap.repaint();
        pShowMap.revalidate();
        int i = tblAllServices.getSelectedRow();
        TableModel model = tblAllServices.getModel();
        Object l = tblAllServices.getValueAt(i, 0);
        service_id = (int) l;
        //browser.reload();
        loadMap2();

    }//GEN-LAST:event_bntMapActionPerformed

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

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

        // FrameAfficherServiceAdmin f = new FrameAfficherServiceAdmin();
        int i = tblAllServices.getSelectedRow();
        Object l = tblAllServices.getValueAt(i, 0);

        ServiceDao sdao = new ServiceDao();

        int j = JOptionPane.showConfirmDialog(null,
                "la suppression est irrversible. Etes-vous sur de vouloir continuer?",
                "Veuillez confirmer votre choix", JOptionPane.YES_NO_OPTION);

        if (j == 0) {
            sdao.removeById((int) l);
            tblAllServices.setModel(new ListeService());
            jScrollPane7.setViewportView(tblAllServices);

        }
    }//GEN-LAST:event_bntSupprimerActionPerformed

    private void tbProduitsMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tbProduitsMouseClicked

    }//GEN-LAST:event_tbProduitsMouseClicked

    private void btnPartagerActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnPartagerActionPerformed
        int ligneSelectionne = tbProduits.getSelectedRow();
        //on rcupre la valeur de la premire colonne de la ligne slectionn

        Object l = tbProduits.getValueAt(ligneSelectionne, 0);

        String accessToken = "CAACEdEose0cBAMDBjsGZBTLZB8BIfLGJGbjs0YZA3tCD3PXrq4sPnLsWYMlcAQzVRESOhmiAcmujhVZAtZAVYGylTOrXfBkHTZAnqsESaJo6Bb1AryqRB08XUmjp2gfvE2W4LJfdhvmJPhyEcFvEIRYgloJgUNcO1tMpOBpAThu7GO7VGaZCYCZCYFZAENcOlfCyUjQJc2qwA9gZDZD";
        FacebookClient fbClient = new DefaultFacebookClient(accessToken);
        User me = fbClient.fetchObject("me", User.class);
        Page userPgae = fbClient.fetchObject("10208045352675324", Page.class);

        System.out.println(me.getName());
        System.out.println(me.getBirthday());

        String nom = (String) tbProduits.getValueAt(ligneSelectionne, 1);
        String categorie = (String) tbProduits.getValueAt(ligneSelectionne, 2);
        int quantite = (int) tbProduits.getValueAt(ligneSelectionne, 3);
        String description = (String) tbProduits.getValueAt(ligneSelectionne, 4);
        float prix = (float) tbProduits.getValueAt(ligneSelectionne, 5);
        int pointBonus = (int) tbProduits.getValueAt(ligneSelectionne, 6);
        String zone = (String) tbProduits.getValueAt(ligneSelectionne, 7);
        Date dateAjout = (Date) tbProduits.getValueAt(ligneSelectionne, 8);
        float TVA = (float) tbProduits.getValueAt(ligneSelectionne, 9);
        float reduction = (float) tbProduits.getValueAt(ligneSelectionne, 10);
        int rating = (int) tbProduits.getValueAt(ligneSelectionne, 11);

        fbClient.publish("10208045352675324" + "/feed", FacebookType.class,
                Parameter.with("message",
                        "nom du produit : " + nom + "\nCategorie : " + categorie + "\nQuantite : " + quantite
                                + "\nDescription : " + description + "\nPrix : " + prix + "\nPoint Bonus: "
                                + pointBonus + "\nGouvernorat : " + zone + "\n Date Ajout :" + dateAjout + "TVA : "
                                + TVA + "\nRduction : " + reduction + "\rating" + rating));

        JOptionPane.showMessageDialog(null, "Shared Succefully on Facebook!");
    }//GEN-LAST:event_btnPartagerActionPerformed

    private void btnConsulterProduitMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_btnConsulterProduitMouseClicked
        // TODO add your handling code here:
    }//GEN-LAST:event_btnConsulterProduitMouseClicked

    private void btnConsulterProduitActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnConsulterProduitActionPerformed
        int i = tbProduits.getSelectedRow();
        TableModel model = tbProduits.getModel();
        Object l = tbProduits.getValueAt(i, 0);
        produit_id = (int) l;
        System.out.println(tbProduits);

        lNomProduit.setText(model.getValueAt(i, 1).toString());
        lCategorie.setText(model.getValueAt(i, 2).toString());
        lQuantite.setText(model.getValueAt(i, 3).toString());
        lDescription.setText(model.getValueAt(i, 4).toString());
        lPrix.setText(model.getValueAt(i, 5).toString());
        lPointBonus.setText(model.getValueAt(i, 6).toString());
        lZone.setText(model.getValueAt(i, 7).toString());
        lTVA.setText(model.getValueAt(i, 9).toString());
        lReduction.setText(model.getValueAt(i, 10).toString());

        Produit p = pdao.findById(produit_id);
        tbCommProd.setModel(new CommentDPModel());
        tbCommProd.setVisible(true);
        tbCommProd.getColumnModel().getColumn(0).setMinWidth(0);
        tbCommProd.getColumnModel().getColumn(0).setMaxWidth(0);
        tbCommProd.getColumnModel().getColumn(0).setWidth(0);
        produitPanel.removeAll();
        produitPanel.add(ConsultationPanel);
        produitPanel.repaint();
        produitPanel.revalidate();

    }//GEN-LAST:event_btnConsulterProduitActionPerformed

    private void btnBackPActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnBackPActionPerformed
        produitPanel.removeAll();
        produitPanel.add(OffresProduitsTableauPanel);
        produitPanel.repaint();
        produitPanel.revalidate();
    }//GEN-LAST:event_btnBackPActionPerformed

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

    private void btnEnvMailActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnEnvMailActionPerformed
        // TODO add your handling code here:
        String to = null;
        UserDao u = new UserDao();
        List listeTo = new ArrayList();
        listeTo = u.findAllEmail();

        String from = "allfordealpi@gmail.com";
        final String username = "allfordealpi@gmail.com";
        final String password = "pidev2016";

        String host = "smtp.gmail.com";

        Properties props = new Properties();
        props.put("mail.smtp.auth", "true");
        props.put("mail.smtp.starttls.enable", "true");
        props.put("mail.smtp.host", host);
        props.put("mail.smtp.port", "587");

        // Get the Session object.
        Session session = Session.getInstance(props, new javax.mail.Authenticator() {
            protected PasswordAuthentication getPasswordAuthentication() {
                return new PasswordAuthentication(username, password);
            }
        });

        try {

            Message message = new MimeMessage(session);

            message.setFrom(new InternetAddress(from));

            for (Object o : listeTo) {

                to = (String) o;
                System.out.println(to);
                message.setRecipients(Message.RecipientType.TO, InternetAddress.parse(to));

                message.setSubject(tfObjet.getText());

                message.setText(taContenu.getText());

                // Send message
                Transport.send(message);
            }
            System.out.println("Sent message successfully....");

        } catch (MessagingException e) {
            throw new RuntimeException(e);
        }

    }//GEN-LAST:event_btnEnvMailActionPerformed

    private void btnReclamActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnReclamActionPerformed
        // TODO add your handling code here:
        ContentPanel.removeAll();
        ContentPanel.add(ReclamPanel);
        ContentPanel.repaint();
        ContentPanel.revalidate();
        ReclamationDao rdao = new ReclamationDao();
        Reclamation r = new Reclamation();
        int ligneSelectionne = tbReclam.getSelectedRow();
        Object l = tbReclam.getValueAt(ligneSelectionne, 0);
        System.out.println(l);
        //r = rdao.removeById((int) l);
    }//GEN-LAST:event_btnReclamActionPerformed

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

    private void btnPanierActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnPanierActionPerformed
        // TODO add your handling code here:
        FramePanierAdmin FPA = new FramePanierAdmin();
        FPA.setVisible(true);
    }//GEN-LAST:event_btnPanierActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* 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(DashbordAdminFrame.class.getName())
                    .log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(DashbordAdminFrame.class.getName())
                    .log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(DashbordAdminFrame.class.getName())
                    .log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(DashbordAdminFrame.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() {
                try {
                    new DashbordAdminFrame().setVisible(true);
                } catch (UnsupportedLookAndFeelException ex) {
                    Logger.getLogger(DashbordAdminFrame.class.getName()).log(Level.SEVERE, null, ex);
                } catch (ParseException ex) {
                    Logger.getLogger(DashbordAdminFrame.class.getName()).log(Level.SEVERE, null, ex);
                } catch (java.text.ParseException ex) {
                    Logger.getLogger(DashbordAdminFrame.class.getName()).log(Level.SEVERE, null, ex);
                }
            }
        });
    }

    private void loadMap2() {

        Service s = sdao.findById(service_id);

        System.out.println(s.getZone());

        pShowMap.setLayout(new BorderLayout());
        int i = 0;
        //pShowMap.add(view, BorderLayout.CENTER);
        java.util.List<Zone> obj = sdao.findByZone(s.getZone());

        double x;
        double y;
        for (Object o : obj) {
            x = ((Zone) o).getLat();
            y = ((Zone) o).getLon();
            System.out.println(x + "dddddddddd" + y);
            // browser.loadURL("https://maps.googleapis.com/maps/api/staticmap?center=" + x + "," + y + "&zoom=12&size=700x500&maptype=roadmap&markers=icone%7Clabel:S%7C" + x + "," + y);

        }

    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JPanel ConsultationPanel;
    private javax.swing.JPanel ContentPanel;
    private javax.swing.JPanel HeadPanel;
    private javax.swing.JPanel MailPanel;
    private javax.swing.JPanel OffresProduitsTableauPanel;
    private javax.swing.JPanel ReclamPanel;
    private javax.swing.JPanel ServicePanel;
    private javax.swing.JButton bntMap;
    private javax.swing.JButton bntSupprimer;
    private javax.swing.JButton btnBackP;
    private javax.swing.JButton btnBackS2;
    private javax.swing.JButton btnCommenter1;
    private javax.swing.JButton btnConsulterProduit;
    private javax.swing.JButton btnConsulterS1;
    private javax.swing.JButton btnEnvMail;
    private javax.swing.JButton btnGProduits;
    private javax.swing.JButton btnGService;
    private javax.swing.JButton btnGUser;
    private javax.swing.JButton btnMail;
    private javax.swing.JButton btnPanier;
    private javax.swing.JButton btnPartager;
    private javax.swing.JButton btnReclam;
    private javax.swing.JButton btnStatistique;
    private javax.swing.JButton btnSupprimerCommentaire;
    private javax.swing.JButton btnSupprimerReclam;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel26;
    private javax.swing.JLabel jLabel27;
    private javax.swing.JLabel jLabel28;
    private javax.swing.JLabel jLabel29;
    private javax.swing.JLabel jLabel30;
    private javax.swing.JLabel jLabel56;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel5;
    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 jScrollPane7;
    private javax.swing.JLabel lCategorie;
    private javax.swing.JLabel lCategorieServiceAll;
    private javax.swing.JLabel lDescription;
    private javax.swing.JLabel lDescriptionSAll;
    private javax.swing.JLabel lEtatSAll;
    private javax.swing.JLabel lNomProduit;
    private javax.swing.JLabel lNomSAll;
    private javax.swing.JLabel lPointBonus;
    private javax.swing.JLabel lPrix;
    private javax.swing.JLabel lQuantite;
    private javax.swing.JLabel lReduction;
    private javax.swing.JLabel lTVA;
    private javax.swing.JLabel lZone;
    private javax.swing.JLabel lZoneSAll;
    private javax.swing.JPanel menu;
    private javax.swing.JPanel pAllServices;
    private javax.swing.JPanel pConsulterS2;
    private javax.swing.JPanel pDetailS;
    private javax.swing.JPanel pShowMap;
    private javax.swing.JPanel pShowMap1;
    private javax.swing.JPanel produitPanel;
    private javax.swing.JPanel statistiquePanel;
    private javax.swing.JTextArea taContenu;
    private javax.swing.JTable tbCommProd;
    private static javax.swing.JTable tbCommentairesService;
    private static javax.swing.JTable tbProduits;
    private javax.swing.JTable tbReclam;
    private javax.swing.JTable tblAllServices;
    private javax.swing.JTextField tfComment;
    private javax.swing.JTextField tfObjet;
    // End of variables declaration//GEN-END:variables
}