IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

API standards et tierces Java Discussion :

[javax.mail]comment envoyer une notification en java


Sujet :

API standards et tierces Java

  1. #1
    Futur Membre du Club
    Femme Profil pro
    developpeur
    Inscrit en
    Septembre 2017
    Messages
    19
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Âge : 35
    Localisation : Algérie

    Informations professionnelles :
    Activité : developpeur

    Informations forums :
    Inscription : Septembre 2017
    Messages : 19
    Points : 5
    Points
    5
    Par défaut [javax.mail]comment envoyer une notification en java
    Bonsoir,
    Je developpe une application workflow en java netbeans,et la je dois programmer des notifications qui seront envoyées a des boites gmail,j"ai inserer ce code mais il ne marche pas. s'il vous plait est ce que quelqu'un peut me donner une solution a mon probleme
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    package application;
     
    import java.util.Properties;
    import javax.mail.Message;
    import javax.mail.Session;
    import javax.mail.internet.InternetAddress;
    import javax.mail.internet.MimeMessage;
     
    import java.io.*;
    import java.util.*;
    import javax.mail.*;
     
    import javax.mail.internet.*;
    /**
     *
     * @author EliteBook
     */
    public class mail {
    private String username="sousssu.h@gmail.com";
    private String password="424365562";
    public void envoyer(){
        Properties props= new Properties();
        props.put("mail.smtp.auth", "true");
        props.put("mail.smtp.starttls.enable", "true");
        props.put("mail.smtp.host", "smtp.gmail.com");
        props.put("mail.smtp.port", "587");
     
        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("sousssu.h@gmail.com"));
            message.setRecipients(Message.RecipientType.TO,InternetAddress.parse("JULI.k@gmail.com"));
            message.setSubject("test");
            message.setText("bonjour");
            Transport.send(message);
            System.out.println("message envoyé");  
        }
        catch(MessagingException e){
           throw new RuntimeException();
        }
        }
     
     
    /** Programme principal*/
    public static void main(String[] av) {
    mail evet=new mail();
    evet.envoyer();
    }
    }

    c'est ce qui m'affiche apres execution:
    Exception in thread "main" java.lang.RuntimeException
    at application.mail.envoyer(mail.java:48)
    at application.mail.main(mail.java:56)
    Java Result: 1

  2. #2
    Modérateur
    Avatar de joel.drigo
    Homme Profil pro
    Ingénieur R&D - Développeur Java
    Inscrit en
    Septembre 2009
    Messages
    12 430
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 54
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : Ingénieur R&D - Développeur Java
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Septembre 2009
    Messages : 12 430
    Points : 29 131
    Points
    29 131
    Billets dans le blog
    2
    Par défaut
    Salut,

    Tu perds la vraie exception en faisant :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    catch(MessagingException e){
           throw new RuntimeException();
        }
    Avoir l'exception réelle te permettrait de mieux comprendre ce qui ne va pas. Tu peux faire comme ça :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    catch(MessagingException e){
           throw new RuntimeException(e);
        }
    L'expression "ça marche pas" ne veut rien dire. Indiquez l'erreur, et/ou les comportements attendus et obtenus, et donnez un Exemple Complet Minimal qui permet de reproduire le problème.
    La plupart des réponses à vos questions sont déjà dans les FAQs ou les Tutoriels, ou peut-être dans une autre discussion : utilisez la recherche interne.
    Des questions sur Java : consultez le Forum Java. Des questions sur l'EDI Eclipse ou la plateforme Eclipse RCP : consultez le Forum Eclipse.
    Une question correctement posée et rédigée et vous aurez plus de chances de réponses adaptées et rapides.
    N'oubliez pas de mettre vos extraits de code entre balises CODE (Voir Mode d'emploi de l'éditeur de messages).
    Nouveau sur le forum ? Consultez Les Règles du Club.

  3. #3
    Futur Membre du Club
    Femme Profil pro
    developpeur
    Inscrit en
    Septembre 2017
    Messages
    19
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Âge : 35
    Localisation : Algérie

    Informations professionnelles :
    Activité : developpeur

    Informations forums :
    Inscription : Septembre 2017
    Messages : 19
    Points : 5
    Points
    5
    Par défaut
    merci,
    est ce que quelqu'un peut m'aider a resoudre ce probleme d'execution:
    Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
    at javax.swing.border.BevelBorder.<init>(BevelBorder.java:78)
    at javax.swing.BorderFactory.createBevelBorder(BorderFactory.java:155)
    at application.Admin.initComponents(Admin.java:715)
    at application.Admin.<init>(Admin.java:50)
    at application.Admin$19.run(Admin.java:946)
    at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:756)
    at java.awt.EventQueue.access$500(EventQueue.java:97)
    at java.awt.EventQueue$3.run(EventQueue.java:709)
    at java.awt.EventQueue$3.run(EventQueue.java:703)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:726)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
    BUILD SUCCESSFUL (total time: 5 seconds)

  4. #4
    Modérateur
    Avatar de joel.drigo
    Homme Profil pro
    Ingénieur R&D - Développeur Java
    Inscrit en
    Septembre 2009
    Messages
    12 430
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 54
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : Ingénieur R&D - Développeur Java
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Septembre 2009
    Messages : 12 430
    Points : 29 131
    Points
    29 131
    Billets dans le blog
    2
    Par défaut
    Citation Envoyé par coucouS Voir le message
    est ce que quelqu'un peut m'aider a resoudre ce probleme d'execution:
    Ce serait plus facile avec ton code !

    Il faut aussi lire la stacktrace :
    Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
    at javax.swing.border.BevelBorder.<init>(BevelBorder.java:78
    at javax.swing.BorderFactory.createBevelBorder(BorderFactory.java:155)
    at application.Admin.initComponents(Admin.java:715)
    On voit qu'il y a une NullPointerException, à la ligne 715 du fichier application/Admin.java, ligne dans laquelle un BevelBorder est créé avec un paramètre null à priori, la couleur de highlight :

    Si le Border est créé comme ça :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    BorderFactory.createBevelBorder(BevelBorder.LOWERED, highlight, shadow);
    et que highlight est null, alors tu auras cette exception.

    Mais sans avoir cette partie de ton code, impossible de d'en dire plus.
    L'expression "ça marche pas" ne veut rien dire. Indiquez l'erreur, et/ou les comportements attendus et obtenus, et donnez un Exemple Complet Minimal qui permet de reproduire le problème.
    La plupart des réponses à vos questions sont déjà dans les FAQs ou les Tutoriels, ou peut-être dans une autre discussion : utilisez la recherche interne.
    Des questions sur Java : consultez le Forum Java. Des questions sur l'EDI Eclipse ou la plateforme Eclipse RCP : consultez le Forum Eclipse.
    Une question correctement posée et rédigée et vous aurez plus de chances de réponses adaptées et rapides.
    N'oubliez pas de mettre vos extraits de code entre balises CODE (Voir Mode d'emploi de l'éditeur de messages).
    Nouveau sur le forum ? Consultez Les Règles du Club.

  5. #5
    Futur Membre du Club
    Femme Profil pro
    developpeur
    Inscrit en
    Septembre 2017
    Messages
    19
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Âge : 35
    Localisation : Algérie

    Informations professionnelles :
    Activité : developpeur

    Informations forums :
    Inscription : Septembre 2017
    Messages : 19
    Points : 5
    Points
    5
    Par défaut
    voici mon code,aidez moi a resoudre ce probleme svp

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266
    267
    268
    269
    270
    271
    272
    273
    274
    275
    276
    277
    278
    279
    280
    281
    282
    283
    284
    285
    286
    287
    288
    289
    290
    291
    292
    293
    294
    295
    296
    297
    298
    299
    300
    301
    302
    303
    304
    305
    306
    307
    308
    309
    310
    311
    312
    313
    314
    315
    316
    317
    318
    319
    320
    321
    322
    323
    324
    325
    326
    327
    328
    329
    330
    331
    332
    333
    334
    335
    336
    337
    338
    339
    340
    341
    342
    343
    344
    345
    346
    347
    348
    349
    350
    351
    352
    353
    354
    355
    356
    357
    358
    359
    360
    361
    362
    363
    364
    365
    366
    367
    368
    369
    370
    371
    372
    373
    374
    375
    376
    377
    378
    379
    380
    381
    382
    383
    384
    385
    386
    387
    388
    389
    390
    391
    392
    393
    394
    395
    396
    397
    398
    399
    400
    401
    402
    403
    404
    405
    406
    407
    408
    409
    410
    411
    412
    413
    414
    415
    416
    417
    418
    419
    420
    421
    422
    423
    424
    425
    426
    427
    428
    429
    430
    431
    432
    433
    434
    435
    436
    437
    438
    439
    440
    441
    442
    443
    444
    445
    446
    447
    448
    449
    450
    451
    452
    453
    454
    455
    456
    457
    458
    459
    460
    461
    462
    463
    464
    465
    466
    467
    468
    469
    470
    471
    472
    473
    474
    475
    476
    477
    478
    479
    480
    481
    482
    483
    484
    485
    486
    487
    488
    489
    490
    491
    492
    493
    494
    495
    496
    497
    498
    499
    500
    501
    502
    503
    504
    505
    506
    507
    508
    509
    510
    511
    512
    513
    514
    515
    516
    517
    518
    519
    520
    521
    522
    523
    524
    525
    526
    527
    528
    529
    530
    531
    532
    533
    534
    535
    536
    537
    538
    539
    540
    541
    542
    543
    544
    545
    546
    547
    548
    549
    550
    551
    552
    553
    554
    555
    556
    557
    558
    559
    560
    561
    562
    563
    564
    565
    566
    567
    568
    569
    570
    571
    572
    573
    574
    575
    576
    577
    578
    579
    580
    581
    582
    583
    584
    585
    586
    587
    588
    589
    590
    591
    592
    593
    594
    595
    596
    597
    598
    599
    600
    601
    602
    603
    604
    605
    606
    607
    608
    609
    610
    611
    612
    613
    614
    615
    616
    617
    618
    619
    620
    621
    622
    623
    624
    625
    626
    627
    628
    629
    630
    631
    632
    633
    634
    635
    636
    637
    638
    639
    640
    641
    642
    643
    644
    645
    646
    647
    648
    649
    650
    651
    652
    653
    654
    655
    656
    657
    658
    659
    660
    661
    662
    663
    664
    665
    666
    667
    668
    669
    670
    671
    672
    673
    674
    675
    676
    677
    678
    679
    680
    681
    682
    683
    684
    685
    686
    687
    688
    689
    690
    691
    692
    693
    694
    695
    696
    697
    698
    699
    700
    701
    702
    703
    704
    705
    706
    707
    708
    709
    710
    711
    712
    713
    714
    715
    716
    717
    718
    719
    720
    721
    722
    723
    724
    725
    726
    727
    728
    729
    730
    731
    732
    733
    734
    735
    736
    737
    738
    739
    740
    741
    742
    743
    744
    745
    746
    747
    748
    749
    750
    751
    752
    753
    754
    755
    756
    757
    758
    759
    760
    761
    762
    763
    764
    765
    766
    767
    768
    769
    770
    771
    772
    773
    774
    775
    776
    777
    778
    779
    780
    781
    782
    783
    784
    785
    786
    787
    788
    789
    790
    791
    792
    793
    794
    795
    796
    797
    798
    799
    800
    801
    802
    803
    804
    805
    806
    807
    808
    809
    810
    811
    812
    813
    814
    815
    816
    817
    818
    819
    820
    821
    822
    823
    824
    825
    826
    827
    828
    829
    830
    831
    832
    833
    834
    835
    836
    837
    838
    839
    840
    841
    842
    843
    844
    845
    846
    847
    848
    849
    850
    851
    852
    853
    854
    855
    856
    857
    858
    859
    860
    861
    862
    863
    864
    865
    866
    867
    868
    869
    870
    871
    872
    873
    874
    875
    876
    877
    878
    879
    880
    881
    882
    883
    884
    885
    886
    887
    888
    889
    890
    891
    892
    893
    894
    package application;
     
    import frame.affectercircuit;
    import frame.modifier;
    import frame.modifiervalideurs;
    import frame.panel1;
    import frame.panel2;
    import frame.panelajouteremploye;
    import java.awt.GridBagConstraints;
    import java.awt.GridBagLayout;
    import java.awt.Toolkit;
    import java.sql.Connection;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    import java.sql.Statement;
    import java.util.logging.Level;
    import java.util.logging.Logger;
    import javax.swing.JOptionPane;
    import javax.swing.table.DefaultTableModel;
    import net.proteanit.sql.DbUtils;
     
    /**
     *
     * @author EliteBook
     */
    public class Administrateur extends javax.swing.JFrame {
     
        /**
         * Creates new form GRH
         */
         Connection cnx=null;
    ResultSet res=null;
    ResultSet r=null;
    Statement pre=null;
    Statement pr=null;
        GridBagLayout layout=new GridBagLayout();
        panel1 p1;
        panel2 p2;
        public Administrateur() throws SQLException {
            initComponents();
            Toolkit tk=Toolkit.getDefaultToolkit();
            int xsize=(int)tk.getScreenSize().getWidth();
            int ysize=(int)tk.getScreenSize().getHeight();
            this.setSize(xsize,ysize);
            p1=new panel1();
            p2=new panel2();
            dinamic.setLayout(layout);
            GridBagConstraints c=new GridBagConstraints();
     
            c.gridx=0;
            c.gridy=0;
            dinamic.add(p1,0);
            c.gridx=0;
            c.gridy=0;
            dinamic.add(p2,0);
            p1.setVisible(true);
            p2.setVisible(false);
            cnx=connect.connecterDB();
            Update();
             String sql="select employe.Nom_emp, employe.Pren_emp from compte,employe where compte.Id_emp=employe.Id_emp";
            try{
                pr=connect.connecterDB().createStatement();
                res=pr.executeQuery(sql);
                while(res.next()){
                  val1.addItem(res.getString(1)+ " " +res.getString(2));
                  val2.addItem(res.getString(1)+ " " +res.getString(2));
                  vals1.addItem(res.getString(1)+ " " +res.getString(2));
                  vals2.addItem(res.getString(1)+ " " +res.getString(2));
                }
            }catch(Exception e){
                JOptionPane.showMessageDialog(null,e);
            } 
        }
       private void Update(){
            try{
                String sql="select Desig_circuit,Nom_val1,Nom_val2,Nom_vals1,Nom_vals2 from `circuit`";
                pre=cnx.prepareStatement(sql);
                res=pre.executeQuery(sql);
                Table.setModel(DbUtils.resultSetToTableModel(res));
            }
            catch(Exception e){
                JOptionPane.showMessageDialog(null,e);
            }
        }
        /**
         * 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">                          
        private void initComponents() {
     
            jPanel1 = new javax.swing.JPanel();
            jLabel1 = new javax.swing.JLabel();
            jPanel2 = new javax.swing.JPanel();
            jLabel2 = new javax.swing.JLabel();
            jLabel3 = new javax.swing.JLabel();
            jLabel4 = new javax.swing.JLabel();
            jLabel5 = new javax.swing.JLabel();
            jButton3 = new javax.swing.JButton();
            jLabel6 = new javax.swing.JLabel();
            jTabbedPane1 = new javax.swing.JTabbedPane();
            jPanel4 = new javax.swing.JPanel();
            jPanel8 = new javax.swing.JPanel();
            jButton1 = new javax.swing.JButton();
            jButton2 = new javax.swing.JButton();
            dinamic = new javax.swing.JPanel();
            jPanel5 = new javax.swing.JPanel();
            jPanel7 = new javax.swing.JPanel();
            jScrollPane2 = new javax.swing.JScrollPane();
            Table = new javax.swing.JTable();
            jPanel6 = new javax.swing.JPanel();
            jLabel8 = new javax.swing.JLabel();
            circuit = new javax.swing.JTextField();
            jPanel10 = new javax.swing.JPanel();
            jLabel9 = new javax.swing.JLabel();
            jLabel10 = new javax.swing.JLabel();
            jLabel11 = new javax.swing.JLabel();
            val1 = new javax.swing.JComboBox();
            val2 = new javax.swing.JComboBox();
            jPanel11 = new javax.swing.JPanel();
            jLabel12 = new javax.swing.JLabel();
            jLabel13 = new javax.swing.JLabel();
            jLabel14 = new javax.swing.JLabel();
            vals1 = new javax.swing.JComboBox();
            vals2 = new javax.swing.JComboBox();
            ajouter = new javax.swing.JButton();
            supp = new javax.swing.JButton();
            jButton8 = new javax.swing.JButton();
            jPanel3 = new javax.swing.JPanel();
            jPanel9 = new javax.swing.JPanel();
            jLabel7 = new javax.swing.JLabel();
            badge = new javax.swing.JTextField();
            envoyer = new javax.swing.JButton();
            annuler = new javax.swing.JButton();
            jLabel15 = new javax.swing.JLabel();
            jLabel16 = new javax.swing.JLabel();
            jLabel17 = new javax.swing.JLabel();
            nom = new javax.swing.JTextField();
            prenom = new javax.swing.JTextField();
            mot = new javax.swing.JTextField();
            aff = new javax.swing.JButton();
     
            setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
     
            jPanel1.setBackground(new java.awt.Color(0, 153, 153));
            jPanel1.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED, null, new java.awt.Color(153, 0, 0)));
     
            jLabel1.setFont(new java.awt.Font("Algerian", 1, 36)); // NOI18N
            jLabel1.setForeground(new java.awt.Color(204, 0, 0));
            jLabel1.setText("Espace Administrateur");
     
            javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
            jPanel1.setLayout(jPanel1Layout);
            jPanel1Layout.setHorizontalGroup(
                jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                    .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jLabel1)
                    .addGap(316, 316, 316))
            );
            jPanel1Layout.setVerticalGroup(
                jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel1Layout.createSequentialGroup()
                    .addContainerGap()
                    .addComponent(jLabel1)
                    .addContainerGap(20, Short.MAX_VALUE))
            );
     
            jPanel2.setBackground(new java.awt.Color(204, 204, 255));
            jPanel2.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED, new java.awt.Color(0, 153, 153), new java.awt.Color(0, 153, 153), new java.awt.Color(204, 0, 0), new java.awt.Color(204, 0, 0)));
     
            jLabel2.setBackground(new java.awt.Color(153, 153, 255));
            jLabel2.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N
            jLabel2.setForeground(new java.awt.Color(0, 0, 102));
            jLabel2.setText("  Effectuer une demande");
            jLabel2.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
            jLabel2.addMouseListener(new java.awt.event.MouseAdapter() {
                public void mouseClicked(java.awt.event.MouseEvent evt) {
                    jLabel2MouseClicked(evt);
                }
            });
     
            jLabel3.setBackground(new java.awt.Color(153, 153, 255));
            jLabel3.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N
            jLabel3.setForeground(new java.awt.Color(0, 0, 102));
            jLabel3.setText("         Boite d'envoie");
            jLabel3.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
     
            jLabel4.setBackground(new java.awt.Color(153, 153, 255));
            jLabel4.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N
            jLabel4.setForeground(new java.awt.Color(0, 0, 102));
            jLabel4.setText("             Brouillon");
            jLabel4.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
     
            jLabel5.setBackground(new java.awt.Color(153, 153, 255));
            jLabel5.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N
            jLabel5.setForeground(new java.awt.Color(0, 0, 102));
            jLabel5.setText("      Boite de reception");
            jLabel5.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
     
            jButton3.setIcon(new javax.swing.ImageIcon("C:\\Users\\EliteBook\\Desktop\\Images\\r.jpg")); // NOI18N
            jButton3.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    jButton3ActionPerformed(evt);
                }
            });
     
            jLabel6.setFont(new java.awt.Font("Tahoma", 3, 11)); // NOI18N
            jLabel6.setForeground(new java.awt.Color(0, 0, 102));
            jLabel6.setText("Retour");
     
            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(jLabel2, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(jLabel3, javax.swing.GroupLayout.DEFAULT_SIZE, 172, Short.MAX_VALUE)
                        .addComponent(jLabel4, javax.swing.GroupLayout.DEFAULT_SIZE, 172, Short.MAX_VALUE)
                        .addComponent(jLabel5, javax.swing.GroupLayout.DEFAULT_SIZE, 172, Short.MAX_VALUE))
                    .addContainerGap())
                .addGroup(jPanel2Layout.createSequentialGroup()
                    .addComponent(jButton3, javax.swing.GroupLayout.PREFERRED_SIZE, 54, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(jLabel6, javax.swing.GroupLayout.PREFERRED_SIZE, 48, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(0, 0, Short.MAX_VALUE))
            );
            jPanel2Layout.setVerticalGroup(
                jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel2Layout.createSequentialGroup()
                    .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addComponent(jButton3, javax.swing.GroupLayout.PREFERRED_SIZE, 47, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jLabel6))
                    .addGap(7, 7, 7)
                    .addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(18, 18, 18)
                    .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(18, 18, 18)
                    .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(18, 18, 18)
                    .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
            );
     
            jTabbedPane1.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N
     
            jPanel8.setBackground(new java.awt.Color(204, 204, 255));
            jPanel8.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED, null, null, new java.awt.Color(0, 0, 102), new java.awt.Color(0, 0, 102)));
     
            jButton1.setBackground(new java.awt.Color(153, 153, 255));
            jButton1.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N
            jButton1.setForeground(new java.awt.Color(0, 0, 102));
            jButton1.setText("Ajouter un compte ");
            jButton1.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
            jButton1.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    jButton1ActionPerformed(evt);
                }
            });
     
            jButton2.setBackground(new java.awt.Color(153, 153, 255));
            jButton2.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N
            jButton2.setForeground(new java.awt.Color(0, 0, 102));
            jButton2.setText("Modifier/Supprimer");
            jButton2.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
            jButton2.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    jButton2ActionPerformed(evt);
                }
            });
     
            javax.swing.GroupLayout jPanel8Layout = new javax.swing.GroupLayout(jPanel8);
            jPanel8.setLayout(jPanel8Layout);
            jPanel8Layout.setHorizontalGroup(
                jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel8Layout.createSequentialGroup()
                    .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addComponent(jButton1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 153, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jButton2, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 153, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addContainerGap())
            );
            jPanel8Layout.setVerticalGroup(
                jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel8Layout.createSequentialGroup()
                    .addGap(50, 50, 50)
                    .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(18, 18, 18)
                    .addComponent(jButton2, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addContainerGap(436, Short.MAX_VALUE))
            );
     
            dinamic.setBackground(new java.awt.Color(153, 204, 255));
            dinamic.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED, null, null, new java.awt.Color(0, 0, 102), new java.awt.Color(0, 0, 102)));
     
            javax.swing.GroupLayout dinamicLayout = new javax.swing.GroupLayout(dinamic);
            dinamic.setLayout(dinamicLayout);
            dinamicLayout.setHorizontalGroup(
                dinamicLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGap(0, 911, Short.MAX_VALUE)
            );
            dinamicLayout.setVerticalGroup(
                dinamicLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGap(0, 0, Short.MAX_VALUE)
            );
     
            javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
            jPanel4.setLayout(jPanel4Layout);
            jPanel4Layout.setHorizontalGroup(
                jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel4Layout.createSequentialGroup()
                    .addComponent(jPanel8, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(dinamic, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
            );
            jPanel4Layout.setVerticalGroup(
                jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addComponent(jPanel8, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(dinamic, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            );
     
            jTabbedPane1.addTab("Gestion des comptes utilisateur", jPanel4);
     
            jPanel5.setBackground(new java.awt.Color(153, 153, 255));
     
            jPanel7.setBackground(new java.awt.Color(153, 204, 255));
            jPanel7.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
     
            Table.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N
            Table.setModel(new javax.swing.table.DefaultTableModel(
                new Object [][] {
     
                },
                new String [] {
                    "Nom du circuit", "Premier valideur1", "Premier valideur2", "Valideur secondaire1", "Valideur secondaire2"
                }
            ));
            Table.addMouseListener(new java.awt.event.MouseAdapter() {
                public void mouseClicked(java.awt.event.MouseEvent evt) {
                    TableMouseClicked(evt);
                }
            });
            jScrollPane2.setViewportView(Table);
     
            jPanel6.setBackground(new java.awt.Color(255, 255, 255));
            jPanel6.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED, new java.awt.Color(0, 0, 0), new java.awt.Color(0, 0, 0), new java.awt.Color(0, 0, 0), new java.awt.Color(0, 0, 0)));
     
            jLabel8.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N
            jLabel8.setText("Nom du circuit:");
     
            circuit.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.RAISED, null, null, new java.awt.Color(255, 102, 102), new java.awt.Color(255, 102, 102)));
     
            jPanel10.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.RAISED, new java.awt.Color(0, 0, 102), new java.awt.Color(0, 0, 102), new java.awt.Color(0, 0, 102), new java.awt.Color(0, 0, 102)));
     
            jLabel9.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N
            jLabel9.setForeground(new java.awt.Color(0, 0, 102));
            jLabel9.setText("Premier valideur");
     
            jLabel10.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N
            jLabel10.setText("Premier valideur1:");
     
            jLabel11.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N
            jLabel11.setText("Premier valideur2:");
     
            javax.swing.GroupLayout jPanel10Layout = new javax.swing.GroupLayout(jPanel10);
            jPanel10.setLayout(jPanel10Layout);
            jPanel10Layout.setHorizontalGroup(
                jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel10Layout.createSequentialGroup()
                    .addGap(25, 25, 25)
                    .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                        .addComponent(jLabel10, javax.swing.GroupLayout.DEFAULT_SIZE, 118, Short.MAX_VALUE)
                        .addComponent(jLabel11, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addComponent(val1, javax.swing.GroupLayout.PREFERRED_SIZE, 178, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(val2, javax.swing.GroupLayout.PREFERRED_SIZE, 178, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel10Layout.createSequentialGroup()
                    .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jLabel9, javax.swing.GroupLayout.PREFERRED_SIZE, 101, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(161, 161, 161))
            );
            jPanel10Layout.setVerticalGroup(
                jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel10Layout.createSequentialGroup()
                    .addComponent(jLabel9)
                    .addGap(18, 18, 18)
                    .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                        .addComponent(jLabel10, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(val1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGap(18, 18, 18)
                    .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addComponent(jLabel11, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(val2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGap(0, 22, Short.MAX_VALUE))
            );
     
            jPanel11.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.RAISED, new java.awt.Color(0, 0, 102), new java.awt.Color(0, 0, 102), new java.awt.Color(0, 0, 102), new java.awt.Color(0, 0, 102)));
     
            jLabel12.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N
            jLabel12.setForeground(new java.awt.Color(0, 0, 102));
            jLabel12.setText("Valideur secondaire");
     
            jLabel13.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N
            jLabel13.setText("Valideur secondaire1:");
     
            jLabel14.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N
            jLabel14.setText("Valideur secondaire2:");
     
            javax.swing.GroupLayout jPanel11Layout = new javax.swing.GroupLayout(jPanel11);
            jPanel11.setLayout(jPanel11Layout);
            jPanel11Layout.setHorizontalGroup(
                jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel11Layout.createSequentialGroup()
                    .addGap(25, 25, 25)
                    .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                        .addComponent(jLabel13, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(jLabel14, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addComponent(vals1, javax.swing.GroupLayout.PREFERRED_SIZE, 178, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(vals2, javax.swing.GroupLayout.PREFERRED_SIZE, 178, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addContainerGap(108, Short.MAX_VALUE))
                .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel11Layout.createSequentialGroup()
                    .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jLabel12, javax.swing.GroupLayout.PREFERRED_SIZE, 135, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(131, 131, 131))
            );
            jPanel11Layout.setVerticalGroup(
                jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel11Layout.createSequentialGroup()
                    .addComponent(jLabel12)
                    .addGap(22, 22, 22)
                    .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                        .addComponent(jLabel13, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(vals1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGap(18, 18, 18)
                    .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addComponent(jLabel14, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(vals2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGap(0, 23, Short.MAX_VALUE))
            );
     
            javax.swing.GroupLayout jPanel6Layout = new javax.swing.GroupLayout(jPanel6);
            jPanel6.setLayout(jPanel6Layout);
            jPanel6Layout.setHorizontalGroup(
                jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel6Layout.createSequentialGroup()
                    .addGap(98, 98, 98)
                    .addComponent(jLabel8, javax.swing.GroupLayout.PREFERRED_SIZE, 101, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(circuit, javax.swing.GroupLayout.PREFERRED_SIZE, 166, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addGroup(jPanel6Layout.createSequentialGroup()
                    .addContainerGap()
                    .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addComponent(jPanel10, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(jPanel11, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addContainerGap())
            );
            jPanel6Layout.setVerticalGroup(
                jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel6Layout.createSequentialGroup()
                    .addContainerGap()
                    .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jLabel8, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(circuit, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGap(18, 18, 18)
                    .addComponent(jPanel10, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                    .addComponent(jPanel11, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addContainerGap(34, Short.MAX_VALUE))
            );
     
            ajouter.setBackground(new java.awt.Color(204, 204, 255));
            ajouter.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N
            ajouter.setText("Ajouter");
            ajouter.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.RAISED));
            ajouter.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    ajouterActionPerformed(evt);
                }
            });
     
            supp.setBackground(new java.awt.Color(204, 204, 255));
            supp.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N
            supp.setText("Supprimer");
            supp.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.RAISED));
            supp.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    suppActionPerformed(evt);
                }
            });
     
            jButton8.setBackground(new java.awt.Color(204, 204, 255));
            jButton8.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N
            jButton8.setText("Annuler");
            jButton8.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.RAISED));
            jButton8.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    jButton8ActionPerformed(evt);
                }
            });
     
            javax.swing.GroupLayout jPanel7Layout = new javax.swing.GroupLayout(jPanel7);
            jPanel7.setLayout(jPanel7Layout);
            jPanel7Layout.setHorizontalGroup(
                jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel7Layout.createSequentialGroup()
                    .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(jPanel7Layout.createSequentialGroup()
                            .addContainerGap()
                            .addComponent(jPanel6, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addGap(10, 10, 10))
                        .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel7Layout.createSequentialGroup()
                            .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jButton8, javax.swing.GroupLayout.PREFERRED_SIZE, 90, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGap(27, 27, 27)
                            .addComponent(supp, javax.swing.GroupLayout.PREFERRED_SIZE, 90, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGap(26, 26, 26)
                            .addComponent(ajouter, javax.swing.GroupLayout.PREFERRED_SIZE, 90, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGap(64, 64, 64)))
                    .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 589, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addContainerGap())
            );
            jPanel7Layout.setVerticalGroup(
                jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel7Layout.createSequentialGroup()
                    .addContainerGap(42, Short.MAX_VALUE)
                    .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                        .addGroup(jPanel7Layout.createSequentialGroup()
                            .addComponent(jPanel6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGap(18, 18, 18)
                            .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel7Layout.createSequentialGroup()
                                    .addGap(1, 1, 1)
                                    .addComponent(supp, javax.swing.GroupLayout.DEFAULT_SIZE, 36, Short.MAX_VALUE))
                                .addComponent(ajouter, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addComponent(jButton8, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                            .addGap(11, 11, 11))
                        .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 488, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGap(34, 34, 34))
            );
     
            javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
            jPanel5.setLayout(jPanel5Layout);
            jPanel5Layout.setHorizontalGroup(
                jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addComponent(jPanel7, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            );
            jPanel5Layout.setVerticalGroup(
                jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addComponent(jPanel7, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            );
     
            jTabbedPane1.addTab("Gestion des circuits de validation", jPanel5);
     
            jPanel3.setBackground(new java.awt.Color(153, 204, 255));
     
            jPanel9.setBackground(new java.awt.Color(255, 255, 255));
            jPanel9.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED, new java.awt.Color(0, 0, 0), new java.awt.Color(0, 0, 0), null, null));
     
            jLabel7.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N
            jLabel7.setText("Numéro du badge:");
     
            badge.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.RAISED, new java.awt.Color(153, 153, 153), new java.awt.Color(153, 153, 153), new java.awt.Color(255, 102, 102), new java.awt.Color(255, 102, 102)));
            badge.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    badgeActionPerformed(evt);
                }
            });
     
            envoyer.setBackground(new java.awt.Color(153, 153, 255));
            envoyer.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N
            envoyer.setForeground(new java.awt.Color(0, 0, 102));
            envoyer.setText("Envoyer");
            envoyer.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    envoyerActionPerformed(evt);
                }
            });
     
            annuler.setBackground(new java.awt.Color(153, 153, 255));
            annuler.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N
            annuler.setForeground(new java.awt.Color(0, 0, 102));
            annuler.setText("Annuler");
     
            jLabel15.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N
            jLabel15.setText("Nom:");
     
            jLabel16.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N
            jLabel16.setText("Prénom:");
     
            jLabel17.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N
            jLabel17.setText("Mot de passe récupéré:");
     
            aff.setIcon(new javax.swing.ImageIcon("C:\\Users\\EliteBook\\Desktop\\Images\\f.png")); // NOI18N
     
            javax.swing.GroupLayout jPanel9Layout = new javax.swing.GroupLayout(jPanel9);
            jPanel9.setLayout(jPanel9Layout);
            jPanel9Layout.setHorizontalGroup(
                jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel9Layout.createSequentialGroup()
                    .addGap(78, 78, 78)
                    .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jLabel16, javax.swing.GroupLayout.PREFERRED_SIZE, 114, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel15, javax.swing.GroupLayout.PREFERRED_SIZE, 114, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addComponent(jLabel17))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addComponent(nom, javax.swing.GroupLayout.PREFERRED_SIZE, 190, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(prenom, javax.swing.GroupLayout.PREFERRED_SIZE, 190, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(mot, javax.swing.GroupLayout.PREFERRED_SIZE, 190, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel9Layout.createSequentialGroup()
                    .addContainerGap(170, Short.MAX_VALUE)
                    .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel9Layout.createSequentialGroup()
                            .addComponent(jLabel7, javax.swing.GroupLayout.PREFERRED_SIZE, 114, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(badge, javax.swing.GroupLayout.PREFERRED_SIZE, 207, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(aff, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGap(192, 192, 192))
                        .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel9Layout.createSequentialGroup()
                            .addComponent(envoyer, javax.swing.GroupLayout.PREFERRED_SIZE, 88, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGap(27, 27, 27)
                            .addComponent(annuler, javax.swing.GroupLayout.PREFERRED_SIZE, 88, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGap(49, 49, 49))))
            );
            jPanel9Layout.setVerticalGroup(
                jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel9Layout.createSequentialGroup()
                    .addGap(23, 23, 23)
                    .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addComponent(aff, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(badge, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel7)))
                    .addGap(34, 34, 34)
                    .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addComponent(jLabel15)
                        .addComponent(nom, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGap(27, 27, 27)
                    .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jLabel16)
                        .addComponent(prenom, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGap(29, 29, 29)
                    .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jLabel17)
                        .addComponent(mot, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 58, Short.MAX_VALUE)
                    .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(annuler, javax.swing.GroupLayout.PREFERRED_SIZE, 27, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(envoyer, javax.swing.GroupLayout.PREFERRED_SIZE, 27, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGap(47, 47, 47))
            );
     
            javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
            jPanel3.setLayout(jPanel3Layout);
            jPanel3Layout.setHorizontalGroup(
                jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel3Layout.createSequentialGroup()
                    .addGap(178, 178, 178)
                    .addComponent(jPanel9, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addContainerGap(200, Short.MAX_VALUE))
            );
            jPanel3Layout.setVerticalGroup(
                jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()
                    .addContainerGap(125, Short.MAX_VALUE)
                    .addComponent(jPanel9, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(114, 114, 114))
            );
     
            jTabbedPane1.addTab("Réinitialiser mot de passe", jPanel3);
     
            javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
            getContentPane().setLayout(layout);
            layout.setHorizontalGroup(
                layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(layout.createSequentialGroup()
                    .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(jTabbedPane1))
            );
            layout.setVerticalGroup(
                layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(layout.createSequentialGroup()
                    .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(jTabbedPane1)))
            );
     
            pack();
        }// </editor-fold>                        
     
     
        private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {                                         
            // TODO add your handling code here:
            p1.setVisible(true);
            p2.setVisible(false);
     
        }                                        
     
        private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {                                         
            // TODO add your handling code here:
             p2.setVisible(true);
             p1.setVisible(false);
     
        }                                        
     
        private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {                                         
            // TODO add your handling code here:
            login l=new login();
            l.setVisible(true);
     
        }                                        
     
        private void badgeActionPerformed(java.awt.event.ActionEvent evt) {                                      
            // TODO add your handling code here:
        }                                     
     
        private void envoyerActionPerformed(java.awt.event.ActionEvent evt) {                                        
            // TODO add your handling code here:
            if(badge.getText().equals("")||nom.getText().equals("")||prenom.getText().equals("")||mot.getText().equals("")){
            JOptionPane.showMessageDialog(null,"veuillez remplir tous les champs");
            }
     
        }                                       
     
        private void ajouterActionPerformed(java.awt.event.ActionEvent evt) {                                        
            // TODO add your handling code here:
           String nom=circuit.getText();
           String valideur1=(String) val1.getSelectedItem();
           String valideur2=(String) val2.getSelectedItem();
           String valideurs1=(String) vals1.getSelectedItem();
           String valideurs2=(String) vals2.getSelectedItem();
     
            String sql="insert into circuit(Desig_circuit,Nom_val1,Nom_val2,Nom_vals1,Nom_vals2)values('"+nom+"','"+valideur1+"','"+valideur2+"','"+valideurs1+"','"+valideurs2+"')"; 
            try {
                DefaultTableModel model=( DefaultTableModel)Table.getModel();
                model.addRow(new Object[]{circuit.getText(),val1.getSelectedItem(),val2.getSelectedItem(),vals1.getSelectedItem(),vals2.getSelectedItem()});
                 pre=connect.connecterDB().createStatement();
                 pre.executeUpdate(sql);
                 while(res.next()){
                 JOptionPane.showMessageDialog(null,"Le circuit de validation est bien ajouté");
                 }
             } catch (SQLException ex) {
                 Logger.getLogger(panel1.class.getName()).log(Level.SEVERE, null, ex);
             }
        }                                       
     
        private void suppActionPerformed(java.awt.event.ActionEvent evt) {                                     
            // TODO add your handling code here:
            DefaultTableModel model=(DefaultTableModel)Table.getModel();
            String sql="Delete from `circuit` where (Desig_circuit='"+circuit.getText()+"' )";
            try{
            int SelectedRowIndex =Table.getSelectedRow();
            model.removeRow(SelectedRowIndex );
             pre=connect.connecterDB().createStatement();
             pre.executeUpdate(sql);
              JOptionPane.showMessageDialog(null,"Le circuit selectionné est supprimé");
            }catch(Exception e){
              JOptionPane.showMessageDialog(null, e);
     
            } 
        }                                    
     
        private void jButton8ActionPerformed(java.awt.event.ActionEvent evt) {                                         
            // TODO add your handling code here:
            circuit.setText("");
            val1.setSelectedItem("");
            val2.setSelectedItem("");
            vals1.setSelectedItem("");
            vals2.setSelectedItem("");
        }                                        
     
        private void TableMouseClicked(java.awt.event.MouseEvent evt) {                                   
            // TODO add your handling code here:
            DefaultTableModel model=(DefaultTableModel)Table.getModel();
            int selectedRowIndex=Table.getSelectedRow();
            circuit.setText(model.getValueAt(selectedRowIndex,0).toString());
            val2.setSelectedItem(model.getValueAt(selectedRowIndex,1).toString());
            val2.setSelectedItem(model.getValueAt(selectedRowIndex,2).toString());
        }                                  
     
        private void jLabel2MouseClicked(java.awt.event.MouseEvent evt) {                                     
            // TODO add your handling code here:
            effectuerdemande e=new effectuerdemande();
            e.setVisible(true);
        }                                    
     
        /**
         * @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 <a href="http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html" target="_blank">http://download.oracle.com/javase/tu...feel/plaf.html</a> 
             */
            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(GRH.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
            } catch (InstantiationException ex) {
                java.util.logging.Logger.getLogger(GRH.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
            } catch (IllegalAccessException ex) {
                java.util.logging.Logger.getLogger(GRH.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
            } catch (javax.swing.UnsupportedLookAndFeelException ex) {
                java.util.logging.Logger.getLogger(GRH.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
            }
            //</editor-fold>
     
            /* Create and display the form */
            java.awt.EventQueue.invokeLater(new Runnable() {
                public void run() {
                    try {
                        new Administrateur().setVisible(true);
                    } catch (SQLException ex) {
                        Logger.getLogger(GRH.class.getName()).log(Level.SEVERE, null, ex);
                    }
                }
            });
        }
     
        // Variables declaration - do not modify                     
        private javax.swing.JTable Table;
        private javax.swing.JButton aff;
        private javax.swing.JButton ajouter;
        private javax.swing.JButton annuler;
        private javax.swing.JTextField badge;
        private javax.swing.JTextField circuit;
        private javax.swing.JPanel dinamic;
        private javax.swing.JButton envoyer;
        private javax.swing.JButton jButton1;
        private javax.swing.JButton jButton2;
        private javax.swing.JButton jButton3;
        private javax.swing.JButton jButton8;
        private javax.swing.JLabel jLabel1;
        private javax.swing.JLabel jLabel10;
        private javax.swing.JLabel jLabel11;
        private javax.swing.JLabel jLabel12;
        private javax.swing.JLabel jLabel13;
        private javax.swing.JLabel jLabel14;
        private javax.swing.JLabel jLabel15;
        private javax.swing.JLabel jLabel16;
        private javax.swing.JLabel jLabel17;
        private javax.swing.JLabel jLabel2;
        private javax.swing.JLabel jLabel3;
        private javax.swing.JLabel jLabel4;
        private javax.swing.JLabel jLabel5;
        private javax.swing.JLabel jLabel6;
        private javax.swing.JLabel jLabel7;
        private javax.swing.JLabel jLabel8;
        private javax.swing.JLabel jLabel9;
        private javax.swing.JPanel jPanel1;
        private javax.swing.JPanel jPanel10;
        private javax.swing.JPanel jPanel11;
        private javax.swing.JPanel jPanel2;
        private javax.swing.JPanel jPanel3;
        private javax.swing.JPanel jPanel4;
        private javax.swing.JPanel jPanel5;
        private javax.swing.JPanel jPanel6;
        private javax.swing.JPanel jPanel7;
        private javax.swing.JPanel jPanel8;
        private javax.swing.JPanel jPanel9;
        private javax.swing.JScrollPane jScrollPane2;
        private javax.swing.JTabbedPane jTabbedPane1;
        private javax.swing.JTextField mot;
        private javax.swing.JTextField nom;
        private javax.swing.JTextField prenom;
        private javax.swing.JButton supp;
        private javax.swing.JComboBox val1;
        private javax.swing.JComboBox val2;
        private javax.swing.JComboBox vals1;
        private javax.swing.JComboBox vals2;
        // End of variables declaration                   
    }

  6. #6
    Modérateur
    Avatar de joel.drigo
    Homme Profil pro
    Ingénieur R&D - Développeur Java
    Inscrit en
    Septembre 2009
    Messages
    12 430
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 54
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : Ingénieur R&D - Développeur Java
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Septembre 2009
    Messages : 12 430
    Points : 29 131
    Points
    29 131
    Billets dans le blog
    2
    Par défaut
    Je t'ai déjà expliqué comment corriger ton erreur. Tu vas à la ligne siganlée par la stacktrace et tu passe une couleur (une instance de classe Color) au lieu de null pour la couleur de highlight des BevelBorder.

    Par exemple, ici (ligne 143 dans le source donné dans ton message) :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    jPanel1.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED, null, new java.awt.Color(153, 0, 0)));
    Le deuxième paramètre est null, or avec ce constructeur, le deuxième paramètre est la couleur de highlight, et ne doit pas être null.
    L'expression "ça marche pas" ne veut rien dire. Indiquez l'erreur, et/ou les comportements attendus et obtenus, et donnez un Exemple Complet Minimal qui permet de reproduire le problème.
    La plupart des réponses à vos questions sont déjà dans les FAQs ou les Tutoriels, ou peut-être dans une autre discussion : utilisez la recherche interne.
    Des questions sur Java : consultez le Forum Java. Des questions sur l'EDI Eclipse ou la plateforme Eclipse RCP : consultez le Forum Eclipse.
    Une question correctement posée et rédigée et vous aurez plus de chances de réponses adaptées et rapides.
    N'oubliez pas de mettre vos extraits de code entre balises CODE (Voir Mode d'emploi de l'éditeur de messages).
    Nouveau sur le forum ? Consultez Les Règles du Club.

  7. #7
    Futur Membre du Club
    Femme Profil pro
    developpeur
    Inscrit en
    Septembre 2017
    Messages
    19
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Âge : 35
    Localisation : Algérie

    Informations professionnelles :
    Activité : developpeur

    Informations forums :
    Inscription : Septembre 2017
    Messages : 19
    Points : 5
    Points
    5
    Par défaut
    Merci bcp

  8. #8
    Futur Membre du Club
    Femme Profil pro
    developpeur
    Inscrit en
    Septembre 2017
    Messages
    19
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Âge : 35
    Localisation : Algérie

    Informations professionnelles :
    Activité : developpeur

    Informations forums :
    Inscription : Septembre 2017
    Messages : 19
    Points : 5
    Points
    5
    Par défaut
    Je develloppe une appliaction en java et je dois programmer des notifications envoyes comme mail a un compte gmail.
    j'ai utilisé ce code, il ne signale aucune erreur mais l'envoie de mail ne fonctionne pas :


    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
     */
    package application;
     
    import java.util.Properties;
    import javax.mail.Message;
    import javax.mail.Session;
    import javax.mail.internet.InternetAddress;
    import javax.mail.internet.MimeMessage;
     
    import java.io.*;
    import java.util.*;
    import javax.mail.*;
     
    import javax.mail.internet.*;
    /**
     *
     * @author EliteBook
     */
    public class mail {
    private String username="coucou.s@gmail.com";
    private String password="15111996";
    public void envoyer(){
        Properties props= new Properties();
        props.put("mail.smtp.auth", "true");
        props.put("mail.smtp.starttls.enable", "true");
        props.put("mail.smtp.host", "smtp.gmail.com");
        props.put("mail.smtp.port", "587");
     
        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("coucou.s@gmail.com"));
            message.setRecipients(Message.RecipientType.TO,InternetAddress.parse("info.z@gmail.com"));
            message.setSubject("test");
            message.setText("bonjour");
            Transport.send(message);
            System.out.println("message envoyé");  
        }
        catch(MessagingException e){
           throw new RuntimeException(e);
        }
        }
     
     
    /** Programme principal*/
    public static void main(String[] av) {
    mail evet=new mail();
    evet.envoyer();
    }
    }
    Quelqu'un peut m'aider et me dire ce qui ne va pas?

    Merci d'avance

  9. #9
    Modérateur
    Avatar de joel.drigo
    Homme Profil pro
    Ingénieur R&D - Développeur Java
    Inscrit en
    Septembre 2009
    Messages
    12 430
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 54
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : Ingénieur R&D - Développeur Java
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Septembre 2009
    Messages : 12 430
    Points : 29 131
    Points
    29 131
    Billets dans le blog
    2
    Par défaut
    Citation Envoyé par coucouS Voir le message
    il ne signale aucune erreur mais l'envoie de mail ne fonctionne pas : [...]
    Quelqu'un peut m'aider et me dire ce qui ne va pas?
    C'est difficile parce "ne fonctionne pas" ne veut rien dire. Si tu obtiens une erreur, et que tu ne sais comment la corriger, dis-nous laquelle. Si tu n'obtiens pas d'erreur, mais que tu ne retrouves pas le mail dans la boite destination, dis-nous le. Si c'est autre chose, dis-nous le explicitement (dis-nous ce qu'il se passe en résumé).

    En l'occurence, il n'y aucune différence entre ton dernier code et ton code initial, si ce n'est la modification que je t'ai fait faire (pour voir clairement l'erreur justement) et les coordonnées que tu as modifiées.

    En tout cas, si j'exécute ton code avec mes coordonnées il fonctionne sans erreur et je reçois bien le mail envoyé dans la boite destinataire (et si j'essaye en SSL également) . Seulement, il y a une chose importante : gmail bloque par défaut l'utilisation d'un compte gmail par une application qu'il ne considère pas sécurisée. Tu dois recevoir un mail de gmail qui te le dit si c'est le cas et qui explique ce qu'il faut faire. Il faut lire les mails que tu reçois !
    L'expression "ça marche pas" ne veut rien dire. Indiquez l'erreur, et/ou les comportements attendus et obtenus, et donnez un Exemple Complet Minimal qui permet de reproduire le problème.
    La plupart des réponses à vos questions sont déjà dans les FAQs ou les Tutoriels, ou peut-être dans une autre discussion : utilisez la recherche interne.
    Des questions sur Java : consultez le Forum Java. Des questions sur l'EDI Eclipse ou la plateforme Eclipse RCP : consultez le Forum Eclipse.
    Une question correctement posée et rédigée et vous aurez plus de chances de réponses adaptées et rapides.
    N'oubliez pas de mettre vos extraits de code entre balises CODE (Voir Mode d'emploi de l'éditeur de messages).
    Nouveau sur le forum ? Consultez Les Règles du Club.

  10. #10
    Futur Membre du Club
    Femme Profil pro
    developpeur
    Inscrit en
    Septembre 2017
    Messages
    19
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Âge : 35
    Localisation : Algérie

    Informations professionnelles :
    Activité : developpeur

    Informations forums :
    Inscription : Septembre 2017
    Messages : 19
    Points : 5
    Points
    5
    Par défaut
    Voila ce que je recois comme erreurs apres execution:

    Exception in thread "main" java.lang.RuntimeException: javax.mail.AuthenticationFailedException: 534-5.7.14 <https://accounts.google.com/signin/c...1&plt=AKgnsbtv
    534-5.7.14 3QKfvvV-Bva7OVZWOj22nqfNy-8ZnjoWVW4Hh4z_ZwbrxshciqS0Hx1iKya6_1-0LKQ5-Y
    534-5.7.14 wgrEkmUzuR47uLavE4jEUSfsbmRd1_Syx4U2Wuer0CJcWuh3_W3s6GZgGc4Z-coq6pPCUr
    534-5.7.14 IBVKA1Ab-yHwoGuzofA3HeFH9A1bbaxXf12stm8OvhLYuyMln1ZfYo_UZepuHxpLmbBVPL
    534-5.7.14 YLIkQfImrw23c31AkxceDPr2wUdMU> Please log in via your web browser and
    534-5.7.14 then try again.
    534-5.7.14 Learn more at
    534 5.7.14 https://support.google.com/mail/answer/78754 j17sm1457175wrc.5 - gsmtp

    at application.mail.envoyer(mail.java:48)
    at application.mail.main(mail.java:56)
    Caused by: javax.mail.AuthenticationFailedException: 534-5.7.14 <https://accounts.google.com/signin/c...1&plt=AKgnsbtv
    534-5.7.14 3QKfvvV-Bva7OVZWOj22nqfNy-8ZnjoWVW4Hh4z_ZwbrxshciqS0Hx1iKya6_1-0LKQ5-Y
    534-5.7.14 wgrEkmUzuR47uLavE4jEUSfsbmRd1_Syx4U2Wuer0CJcWuh3_W3s6GZgGc4Z-coq6pPCUr
    534-5.7.14 IBVKA1Ab-yHwoGuzofA3HeFH9A1bbaxXf12stm8OvhLYuyMln1ZfYo_UZepuHxpLmbBVPL
    534-5.7.14 YLIkQfImrw23c31AkxceDPr2wUdMU> Please log in via your web browser and
    534-5.7.14 then try again.
    534-5.7.14 Learn more at
    534 5.7.14 https://support.google.com/mail/answer/78754 j17sm1457175wrc.5 - gsmtp

    at com.sun.mail.smtp.SMTPTransport$Authenticator.authenticate(SMTPTransport.java:809)
    at com.sun.mail.smtp.SMTPTransport.authenticate(SMTPTransport.java:752)
    at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:669)
    at javax.mail.Service.connect(Service.java:317)
    at javax.mail.Service.connect(Service.java:176)
    at javax.mail.Service.connect(Service.java:125)
    at javax.mail.Transport.send0(Transport.java:194)
    at javax.mail.Transport.send(Transport.java:124)
    at application.mail.envoyer(mail.java:44)
    ... 1 more
    Java Result: 1
    BUILD SUCCESSFUL (total time: 21 seconds)

  11. #11
    Modérateur
    Avatar de joel.drigo
    Homme Profil pro
    Ingénieur R&D - Développeur Java
    Inscrit en
    Septembre 2009
    Messages
    12 430
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 54
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : Ingénieur R&D - Développeur Java
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Septembre 2009
    Messages : 12 430
    Points : 29 131
    Points
    29 131
    Billets dans le blog
    2
    Par défaut
    javax.mail.AuthenticationFailedException
    Il y a une erreur d'authentification : on obtient cette erreur lorsque les coordonnées (nom de compte, mot de passe) ne sont pas correctes ou que justement gmail bloque la connexion pour les raisons que j'ai déjà évoquées. As-tu regardé dans la boite aux lettres correspondant à ces coordonnées si tu n'avais pas un mail intitulé "Examiner la tentative de connexion bloquée" ?
    L'expression "ça marche pas" ne veut rien dire. Indiquez l'erreur, et/ou les comportements attendus et obtenus, et donnez un Exemple Complet Minimal qui permet de reproduire le problème.
    La plupart des réponses à vos questions sont déjà dans les FAQs ou les Tutoriels, ou peut-être dans une autre discussion : utilisez la recherche interne.
    Des questions sur Java : consultez le Forum Java. Des questions sur l'EDI Eclipse ou la plateforme Eclipse RCP : consultez le Forum Eclipse.
    Une question correctement posée et rédigée et vous aurez plus de chances de réponses adaptées et rapides.
    N'oubliez pas de mettre vos extraits de code entre balises CODE (Voir Mode d'emploi de l'éditeur de messages).
    Nouveau sur le forum ? Consultez Les Règles du Club.

  12. #12
    Futur Membre du Club
    Femme Profil pro
    developpeur
    Inscrit en
    Septembre 2017
    Messages
    19
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Âge : 35
    Localisation : Algérie

    Informations professionnelles :
    Activité : developpeur

    Informations forums :
    Inscription : Septembre 2017
    Messages : 19
    Points : 5
    Points
    5
    Par défaut
    j'ai essayé avec ce code:


    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    public class mail {
    private String username="coucou.s@gmail.com";
    private String password="123456789";
    public void envoyer(){
        Properties props= new Properties();
        props.put("mail.smtp.auth", "true");
        props.put("mail.smtp.starttls.enable", "true");
        props.put("mail.smtp.host", "smtp.gmail.com");
        props.put("mail.smtp.port", "587");
     
        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("coucou.s@gmail.com"));
            message.setRecipients(Message.RecipientType.TO,InternetAddress.parse("info.z@gmail.com"));
            message.setSubject("test");
            message.setText("bonjour");
            Transport.send(message);
            System.out.println("message envoyé");  
        }
        catch(MessagingException e){
           throw new RuntimeException(e);
        }
        }
    et ca me donne ces erreurs:


    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    Exception in thread "main" java.lang.RuntimeException: javax.mail.MessagingException: Could not convert socket to TLS;
      nested exception is:
    	javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake
    	at application.mail.envoyer(mail.java:53)
    	at application.mail.main(mail.java:61)
    Caused by: javax.mail.MessagingException: Could not convert socket to TLS;
      nested exception is:
    	javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake
    	at com.sun.mail.smtp.SMTPTransport.startTLS(SMTPTransport.java:1880)
    	at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:648)
    	at javax.mail.Service.connect(Service.java:317)
    	at javax.mail.Service.connect(Service.java:176)
    	at javax.mail.Service.connect(Service.java:125)
    	at javax.mail.Transport.send0(Transport.java:194)
    	at javax.mail.Transport.send(Transport.java:124)
    	at application.mail.envoyer(mail.java:49)
    	... 1 more
    Caused by: javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake
    	at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1002)
    	at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1385)
    	at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1413)
    	at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1397)
    	at com.sun.mail.util.SocketFetcher.configureSSLSocket(SocketFetcher.java:507)
    	at com.sun.mail.util.SocketFetcher.startTLS(SocketFetcher.java:447)
    	at com.sun.mail.smtp.SMTPTransport.startTLS(SMTPTransport.java:1875)
    	... 8 more
    Caused by: java.io.EOFException: SSL peer shut down incorrectly
    	at sun.security.ssl.InputRecord.read(InputRecord.java:505)
    	at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:983)
    	... 14 more
    Java Result: 1
    BUILD SUCCESSFUL (total time: 1 minute 13 seconds)

  13. #13
    Modérateur
    Avatar de joel.drigo
    Homme Profil pro
    Ingénieur R&D - Développeur Java
    Inscrit en
    Septembre 2009
    Messages
    12 430
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 54
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : Ingénieur R&D - Développeur Java
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Septembre 2009
    Messages : 12 430
    Points : 29 131
    Points
    29 131
    Billets dans le blog
    2
    Par défaut
    Tu dois avoir un firewall ou un proxy qui bloque ta connexion :

    Essaye en ajoutant cette propriété
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    props.put("mail.smtp.ssl.trust", "smtp.gmail.com");
    Ou en supprimant d'abord toutes les propriétés, et en ajoutant celles-là :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    props.put("mail.smtp.auth", "true");
    props.put("mail.smtp.socketFactory.port", "465");
    props.put("mail.smtp.socketFactory.class",
    				"javax.net.ssl.SSLSocketFactory");
    props.put("mail.smtp.host", "smtp.gmail.com"); 
    props.put("mail.smtp.port", "587");
    L'expression "ça marche pas" ne veut rien dire. Indiquez l'erreur, et/ou les comportements attendus et obtenus, et donnez un Exemple Complet Minimal qui permet de reproduire le problème.
    La plupart des réponses à vos questions sont déjà dans les FAQs ou les Tutoriels, ou peut-être dans une autre discussion : utilisez la recherche interne.
    Des questions sur Java : consultez le Forum Java. Des questions sur l'EDI Eclipse ou la plateforme Eclipse RCP : consultez le Forum Eclipse.
    Une question correctement posée et rédigée et vous aurez plus de chances de réponses adaptées et rapides.
    N'oubliez pas de mettre vos extraits de code entre balises CODE (Voir Mode d'emploi de l'éditeur de messages).
    Nouveau sur le forum ? Consultez Les Règles du Club.

  14. #14
    Futur Membre du Club
    Femme Profil pro
    developpeur
    Inscrit en
    Septembre 2017
    Messages
    19
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Âge : 35
    Localisation : Algérie

    Informations professionnelles :
    Activité : developpeur

    Informations forums :
    Inscription : Septembre 2017
    Messages : 19
    Points : 5
    Points
    5
    Par défaut
    Bonjour,
    J'ai remplacé les proprietés par:props.put("mail.smtp.ssl.trust", "smtp.gmail.com");
    et ca me donne ces erreurs:


    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    Exception in thread "main" java.lang.RuntimeException: javax.mail.MessagingException: Could not connect to SMTP host: localhost, port: 25;
      nested exception is:
    	java.net.ConnectException: Connection refused: connect
    	at application.mail.envoyer(mail.java:55)
    	at application.mail.main(mail.java:63)
    Caused by: javax.mail.MessagingException: Could not connect to SMTP host: localhost, port: 25;
      nested exception is:
    	java.net.ConnectException: Connection refused: connect
    	at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1934)
    	at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:638)
    	at javax.mail.Service.connect(Service.java:295)
    	at javax.mail.Service.connect(Service.java:176)
    	at javax.mail.Service.connect(Service.java:125)
    	at javax.mail.Transport.send0(Transport.java:194)
    	at javax.mail.Transport.send(Transport.java:124)
    	at application.mail.envoyer(mail.java:51)
    	... 1 more
    Caused by: java.net.ConnectException: Connection refused: connect
    	at java.net.DualStackPlainSocketImpl.connect0(Native Method)
    	at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:79)
    	at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
    	at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
    	at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
    	at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172)
    	at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
    	at java.net.Socket.connect(Socket.java:589)
    	at java.net.Socket.connect(Socket.java:538)
    	at com.sun.mail.util.SocketFetcher.createSocket(SocketFetcher.java:288)
    	at com.sun.mail.util.SocketFetcher.getSocket(SocketFetcher.java:231)
    	at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1900)
    	... 8 more
    Java Result: 1
    BUILD SUCCESSFUL (total time: 5 seconds)

  15. #15
    Modérateur
    Avatar de joel.drigo
    Homme Profil pro
    Ingénieur R&D - Développeur Java
    Inscrit en
    Septembre 2009
    Messages
    12 430
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 54
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : Ingénieur R&D - Développeur Java
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Septembre 2009
    Messages : 12 430
    Points : 29 131
    Points
    29 131
    Billets dans le blog
    2
    Par défaut
    Tu as remplacé les propriétés par props.put("mail.smtp.ssl.trust", "smtp.gmail.com");, tu veux dire toutes les propriétés ? J'avais dit "ajouter", pas "remplacer" ! C'est pour le deuxième exemple, que j'ai dit "remplacer".
    L'expression "ça marche pas" ne veut rien dire. Indiquez l'erreur, et/ou les comportements attendus et obtenus, et donnez un Exemple Complet Minimal qui permet de reproduire le problème.
    La plupart des réponses à vos questions sont déjà dans les FAQs ou les Tutoriels, ou peut-être dans une autre discussion : utilisez la recherche interne.
    Des questions sur Java : consultez le Forum Java. Des questions sur l'EDI Eclipse ou la plateforme Eclipse RCP : consultez le Forum Eclipse.
    Une question correctement posée et rédigée et vous aurez plus de chances de réponses adaptées et rapides.
    N'oubliez pas de mettre vos extraits de code entre balises CODE (Voir Mode d'emploi de l'éditeur de messages).
    Nouveau sur le forum ? Consultez Les Règles du Club.

  16. #16
    Futur Membre du Club
    Femme Profil pro
    developpeur
    Inscrit en
    Septembre 2017
    Messages
    19
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Âge : 35
    Localisation : Algérie

    Informations professionnelles :
    Activité : developpeur

    Informations forums :
    Inscription : Septembre 2017
    Messages : 19
    Points : 5
    Points
    5
    Par défaut
    J'ai ajouté le code aux proprietés:

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
     props.put("mail.smtp.ssl.trust", "smtp.gmail.com");
        props.put("mail.smtp.auth", "true");
        props.put("mail.smtp.starttls.enable", "true");
        props.put("mail.smtp.host", "smtp.gmail.com");
        props.put("mail.smtp.port", "587");
    et ca me donne toujour ces erreurs:

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    Exception in thread "main" java.lang.RuntimeException: javax.mail.AuthenticationFailedException: 534-5.7.14 <https://accounts.google.com/signin/continue?sarp=1&scc=1&plt=AKgnsbsy
    534-5.7.14 TBdOGRwkQaEO1RdE_g4P3Y7fHNLpOpdQOhq0c-IXnFsgsitWiBotDbAOGIpSV2bqbxhKem
    534-5.7.14 isqSANlPqkAMhUz8elu5kcOZHyulFUH6BTs7xq-kzgMsNYbyG1VeHQvZKAroxjSWYJLo1U
    534-5.7.14 YN27nZMYS25rWRDf1DfGg00Gii81hWCIivWQKtASP8jxEs2qCUImCTswb6Sh0RYPBbnqeI
    534-5.7.14 QkV26Ny5pdPhzG8t4wBkUsSlLQpcc> Please log in via your web browser and
    534-5.7.14 then try again.
    534-5.7.14  Learn more at
    534 5.7.14  https://support.google.com/mail/answer/78754 s9sm549724wra.73 - gsmtp
     
    	at application.mail.envoyer(mail.java:55)
    	at application.mail.main(mail.java:63)
    Caused by: javax.mail.AuthenticationFailedException: 534-5.7.14 <https://accounts.google.com/signin/continue?sarp=1&scc=1&plt=AKgnsbsy
    534-5.7.14 TBdOGRwkQaEO1RdE_g4P3Y7fHNLpOpdQOhq0c-IXnFsgsitWiBotDbAOGIpSV2bqbxhKem
    534-5.7.14 isqSANlPqkAMhUz8elu5kcOZHyulFUH6BTs7xq-kzgMsNYbyG1VeHQvZKAroxjSWYJLo1U
    534-5.7.14 YN27nZMYS25rWRDf1DfGg00Gii81hWCIivWQKtASP8jxEs2qCUImCTswb6Sh0RYPBbnqeI
    534-5.7.14 QkV26Ny5pdPhzG8t4wBkUsSlLQpcc> Please log in via your web browser and
    534-5.7.14 then try again.
    534-5.7.14  Learn more at
    534 5.7.14  https://support.google.com/mail/answer/78754 s9sm549724wra.73 - gsmtp
     
    	at com.sun.mail.smtp.SMTPTransport$Authenticator.authenticate(SMTPTransport.java:809)
    	at com.sun.mail.smtp.SMTPTransport.authenticate(SMTPTransport.java:752)
    	at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:669)
    	at javax.mail.Service.connect(Service.java:317)
    	at javax.mail.Service.connect(Service.java:176)
    	at javax.mail.Service.connect(Service.java:125)
    	at javax.mail.Transport.send0(Transport.java:194)
    	at javax.mail.Transport.send(Transport.java:124)
    	at application.mail.envoyer(mail.java:51)
    	... 1 more
    Java Result: 1
    BUILD SUCCESSFUL (total time: 9 seconds)
    comme j'ai recu ca dans le compte gmail: coucou.s@gmail.com

    Examiner la tentative de connexion bloquée

  17. #17
    Modérateur
    Avatar de joel.drigo
    Homme Profil pro
    Ingénieur R&D - Développeur Java
    Inscrit en
    Septembre 2009
    Messages
    12 430
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 54
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : Ingénieur R&D - Développeur Java
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Septembre 2009
    Messages : 12 430
    Points : 29 131
    Points
    29 131
    Billets dans le blog
    2
    Par défaut
    Citation Envoyé par coucouS Voir le message
    comme j'ai recu ca dans le compte gmail: coucou.s@gmail.com

    Examiner la tentative de connexion bloquée
    Ah, enfin, j'ai une réponse à une de mes questions... enfin une réponse, façon de parler.

    Donc, maintenant tu lis le message, et tu verras qu'on te donne un lien qui va te permettre de débloquer ta connexion.
    L'expression "ça marche pas" ne veut rien dire. Indiquez l'erreur, et/ou les comportements attendus et obtenus, et donnez un Exemple Complet Minimal qui permet de reproduire le problème.
    La plupart des réponses à vos questions sont déjà dans les FAQs ou les Tutoriels, ou peut-être dans une autre discussion : utilisez la recherche interne.
    Des questions sur Java : consultez le Forum Java. Des questions sur l'EDI Eclipse ou la plateforme Eclipse RCP : consultez le Forum Eclipse.
    Une question correctement posée et rédigée et vous aurez plus de chances de réponses adaptées et rapides.
    N'oubliez pas de mettre vos extraits de code entre balises CODE (Voir Mode d'emploi de l'éditeur de messages).
    Nouveau sur le forum ? Consultez Les Règles du Club.

  18. #18
    Futur Membre du Club
    Femme Profil pro
    developpeur
    Inscrit en
    Septembre 2017
    Messages
    19
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Âge : 35
    Localisation : Algérie

    Informations professionnelles :
    Activité : developpeur

    Informations forums :
    Inscription : Septembre 2017
    Messages : 19
    Points : 5
    Points
    5
    Par défaut
    j'ai déblouqué la connexion a mon compte et apres execution du code ca maffiche bien le message:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
     
    message envoyé
    BUILD SUCCESSFUL (total time: 13 seconds)
    Mais dans le compte je ne trouve pas le message envoyé "bonjour"

    Par contre je trouve ca:

    Accés activé pour les applications moins securisées

  19. #19
    Modérateur
    Avatar de joel.drigo
    Homme Profil pro
    Ingénieur R&D - Développeur Java
    Inscrit en
    Septembre 2009
    Messages
    12 430
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 54
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : Ingénieur R&D - Développeur Java
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Septembre 2009
    Messages : 12 430
    Points : 29 131
    Points
    29 131
    Billets dans le blog
    2
    Par défaut
    Citation Envoyé par coucouS Voir le message
    Mais dans le compte je ne trouve pas le message envoyé "bonjour"
    Mais tu regardes bien dans le compte de info.z@gmail.com ?

    Dans celui de coucou.s@gmail.com, tu devrais au moins pouvoir le voir dans les "Messages envoyés".
    L'expression "ça marche pas" ne veut rien dire. Indiquez l'erreur, et/ou les comportements attendus et obtenus, et donnez un Exemple Complet Minimal qui permet de reproduire le problème.
    La plupart des réponses à vos questions sont déjà dans les FAQs ou les Tutoriels, ou peut-être dans une autre discussion : utilisez la recherche interne.
    Des questions sur Java : consultez le Forum Java. Des questions sur l'EDI Eclipse ou la plateforme Eclipse RCP : consultez le Forum Eclipse.
    Une question correctement posée et rédigée et vous aurez plus de chances de réponses adaptées et rapides.
    N'oubliez pas de mettre vos extraits de code entre balises CODE (Voir Mode d'emploi de l'éditeur de messages).
    Nouveau sur le forum ? Consultez Les Règles du Club.

  20. #20
    Futur Membre du Club
    Femme Profil pro
    developpeur
    Inscrit en
    Septembre 2017
    Messages
    19
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Âge : 35
    Localisation : Algérie

    Informations professionnelles :
    Activité : developpeur

    Informations forums :
    Inscription : Septembre 2017
    Messages : 19
    Points : 5
    Points
    5
    Par défaut
    Oui ca a bien marché
    merci pour l'aide que vous m'avez donné

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. Comment envoyer une page web par mail
    Par zgoulanda dans le forum Débuter
    Réponses: 3
    Dernier message: 02/10/2008, 09h30
  2. [Applet] Comment envoyer une variable php au java?
    Par abstractor77 dans le forum Interfaces Graphiques en Java
    Réponses: 1
    Dernier message: 09/03/2006, 10h18
  3. Comment envoyer une requête POST via HTTP ?
    Par pdtor dans le forum C++
    Réponses: 2
    Dernier message: 13/09/2005, 05h54
  4. Comment envoyer une commande en HTTP ?
    Par Promeneur dans le forum Web & réseau
    Réponses: 5
    Dernier message: 08/06/2005, 17h45
  5. Comment envoyer une commande à une console ?
    Par seb_asm dans le forum Assembleur
    Réponses: 3
    Dernier message: 27/03/2004, 14h09

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo