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

NetBeans Java Discussion :

Run file inaccessible.


Sujet :

NetBeans Java

  1. #1
    Membre habitué
    Profil pro
    Inscrit en
    Janvier 2009
    Messages
    469
    Détails du profil
    Informations personnelles :
    Localisation : Belgique

    Informations forums :
    Inscription : Janvier 2009
    Messages : 469
    Points : 149
    Points
    149
    Par défaut Run file inaccessible.
    Bonjour a tous,

    Pour quelle raison ma commande run file est-elle inaccessible (couleur grise) ?

    Merci a vous

    Habiler

  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,

    De quoi parles-tu ? C'est quoi une commande run file ?
    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
    Membre habitué
    Profil pro
    Inscrit en
    Janvier 2009
    Messages
    469
    Détails du profil
    Informations personnelles :
    Localisation : Belgique

    Informations forums :
    Inscription : Janvier 2009
    Messages : 469
    Points : 149
    Points
    149
    Par défaut
    C est le Shift + F6 mais c est avec netbeans

    sorry

    Habiler

  4. #4
    Modérateur

    Homme Profil pro
    Développeur java, access, sql server
    Inscrit en
    Octobre 2005
    Messages
    2 710
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Val de Marne (Île de France)

    Informations professionnelles :
    Activité : Développeur java, access, sql server
    Secteur : Industrie

    Informations forums :
    Inscription : Octobre 2005
    Messages : 2 710
    Points : 4 794
    Points
    4 794
    Par défaut
    La classe sélectionnée ne comporte pas de méthode main
    Labor improbus omnia vincit un travail acharné vient à bout de tout - Ambroise Paré (1510-1590)

    Consulter sans modération la FAQ ainsi que les bons ouvrages : http://jmdoudoux.developpez.com/cours/developpons/java/

  5. #5
    Membre habitué
    Profil pro
    Inscrit en
    Janvier 2009
    Messages
    469
    Détails du profil
    Informations personnelles :
    Localisation : Belgique

    Informations forums :
    Inscription : Janvier 2009
    Messages : 469
    Points : 149
    Points
    149
    Par défaut
    Bonsoir a tous.

    Merci pour la reponse.

    Mon 'main'se trouve asse loin ligne 560.

    Habiler

    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
    package decisions;
    
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.event.ActionEvent;
    import java.sql.*;
    import javax.swing.*;
    import java.util.Calendar;
    import javax.swing.border.*;
    import com.toedter.calendar.*;
    import java.beans.PropertyChangeListener;
    
    
    public class AddDecisionsJFrame extends javax.swing.JFrame {
    
    Connection conn =null;
    ResultSet rs = null;
    PreparedStatement ps = null;
     //   private Object oui;
       
        /**
         * Creates new form DeciiJFrame
         */
        public AddDecisionsJFrame() {
            initComponents();
        }
    
           
        @SuppressWarnings("unchecked")
        // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
        // Generated using JFormDesigner non-commercial license
        private void initComponents() {
            jLabel1 = new JLabel();
            CmdSave = new JButton();
            jLabel2 = new JLabel();
            TxtDecId = new JTextField();
            jLabel3 = new JLabel();
            jLabel4 = new JLabel();
            TxtNumero = new JTextField();
            jLabel5 = new JLabel();
            jLabel6 = new JLabel();
            jLabel7 = new JLabel();
            DateFinPostpose = new JDateChooser();
            TxtMatr = new JTextField();
            jLabel8 = new JLabel();
            jLabel9 = new JLabel();
            jCheckBoxRefus = new JCheckBox();
            jLabel10 = new JLabel();
            jCheckBox3 = new JCheckBox();
            jCheckBoxPostpose = new JCheckBox();
            jLabel12 = new JLabel();
            jCboPcActivity = new JComboBox<>();
            jCboTypeAbsence = new JComboBox<>();
            jCheckBoxVen1 = new JCheckBox();
            TxtId = new JTextField();
            jDateChooserDebut = new JDateChooser();
            jDateChooserFin = new JDateChooser();
            DateDebutPostpose = new JDateChooser();
            jCheckBoxLun1 = new JCheckBox();
            jCheckBoxMar1 = new JCheckBox();
            jCheckBoxMer1 = new JCheckBox();
            jCheckBoxJeu1 = new JCheckBox();
            jCheckBoxVen2 = new JCheckBox();
            jCheckBoxLun2 = new JCheckBox();
            jCheckBoxMar2 = new JCheckBox();
            jCheckBoxMer2 = new JCheckBox();
            jCheckBoxJeu2 = new JCheckBox();
            jScrollPane1 = new JScrollPane();
            jTextAreaRemarques = new JTextArea();
            jLabel11 = new JLabel();
            jCboFiliation = new JComboBox<>();
            jTextNom_Parent = new JTextField();
            jDateChooserDateDec = new JDateChooser();
            jTextFieldNbrMois = new JTextField();
    
            //======== this ========
            setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
            setTitle("Absences");
            setBackground(new Color(102, 255, 204));
            setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
            setFont(new Font("MS PGothic", Font.BOLD, 18));
            setForeground(Color.blue);
            Container contentPane = getContentPane();
            contentPane.setLayout(null);
    
            //---- jLabel1 ----
            jLabel1.setFont(new Font("Times New Roman", Font.BOLD, 11));
            jLabel1.setText("Id");
            contentPane.add(jLabel1);
            jLabel1.setBounds(24, 42, 28, jLabel1.getPreferredSize().height);
    
            //---- CmdSave ----
            CmdSave.setText("Save record");
            CmdSave.addMouseListener(new MouseAdapter() {
                @Override
                public void mouseClicked(MouseEvent e) {
                    CmdSaveMouseClicked(e);
                }
            });
            contentPane.add(CmdSave);
            CmdSave.setBounds(new Rectangle(new Point(400, 430), CmdSave.getPreferredSize()));
    
            //---- jLabel2 ----
            jLabel2.setFont(new Font("Times New Roman", Font.BOLD, 11));
            jLabel2.setText("DecId");
            contentPane.add(jLabel2);
            jLabel2.setBounds(new Rectangle(new Point(24, 68), jLabel2.getPreferredSize()));
            contentPane.add(TxtDecId);
            TxtDecId.setBounds(140, 65, 91, TxtDecId.getPreferredSize().height);
    
            //---- jLabel3 ----
            jLabel3.setFont(new Font("Times New Roman", Font.BOLD, 11));
            jLabel3.setText("Matricule");
            contentPane.add(jLabel3);
            jLabel3.setBounds(24, 94, 47, jLabel3.getPreferredSize().height);
    
            //---- jLabel4 ----
            jLabel4.setFont(new Font("Times New Roman", Font.BOLD, 11));
            jLabel4.setText("Numero");
            contentPane.add(jLabel4);
            jLabel4.setBounds(24, 150, jLabel4.getPreferredSize().width, 18);
            contentPane.add(TxtNumero);
            TxtNumero.setBounds(140, 150, 91, TxtNumero.getPreferredSize().height);
    
            //---- jLabel5 ----
            jLabel5.setFont(new Font("Times New Roman", Font.BOLD, 11));
            jLabel5.setText("Date d\u00e9cision");
            contentPane.add(jLabel5);
            jLabel5.setBounds(new Rectangle(new Point(24, 119), jLabel5.getPreferredSize()));
    
            //---- jLabel6 ----
            jLabel6.setFont(new Font("Times New Roman", Font.BOLD, 11));
            jLabel6.setText("D\u00e9but de l'absence");
            contentPane.add(jLabel6);
            jLabel6.setBounds(20, 240, jLabel6.getPreferredSize().width, 20);
    
            //---- jLabel7 ----
            jLabel7.setFont(new Font("Times New Roman", Font.BOLD, 11));
            jLabel7.setText("Fin de l'absence");
            contentPane.add(jLabel7);
            jLabel7.setBounds(20, 270, 98, 20);
    
            //---- DateFinPostpose ----
            DateFinPostpose.setDateFormatString("dd-MMM-yyyy");
            DateFinPostpose.setIcon(null);
            DateFinPostpose.addPropertyChangeListener(e -> DateFinPostposePropertyChange(e));
            DateFinPostpose.setVisible(false);
            contentPane.add(DateFinPostpose);
            DateFinPostpose.setBounds(190, 360, 120, DateFinPostpose.getPreferredSize().height);
            contentPane.add(TxtMatr);
            TxtMatr.setBounds(140, 90, 91, TxtMatr.getPreferredSize().height);
    
            //---- jLabel8 ----
            jLabel8.setFont(new Font("Times New Roman", Font.BOLD, 11));
            jLabel8.setText("Pc d'activit\u00e9");
            contentPane.add(jLabel8);
            jLabel8.setBounds(18, 180, 110, 20);
    
            //---- jLabel9 ----
            jLabel9.setFont(new Font("Times New Roman", Font.BOLD, 11));
            jLabel9.setText("Type d'absence");
            contentPane.add(jLabel9);
            jLabel9.setBounds(20, 210, jLabel9.getPreferredSize().width, 20);
            contentPane.add(jCheckBoxRefus);
            jCheckBoxRefus.setBounds(new Rectangle(new Point(140, 300), jCheckBoxRefus.getPreferredSize()));
    
            //---- jLabel10 ----
            jLabel10.setFont(new Font("Times New Roman", Font.BOLD, 11));
            jLabel10.setText("Refus");
            contentPane.add(jLabel10);
            jLabel10.setBounds(20, 300, 100, 20);
            contentPane.add(jCheckBox3);
            jCheckBox3.setBounds(new Rectangle(new Point(140, 300), jCheckBox3.getPreferredSize()));
    
            //---- jCheckBoxPostpose ----
            jCheckBoxPostpose.addActionListener(e -> jCheckBoxPostposeActionPerformed(e));
            contentPane.add(jCheckBoxPostpose);
            jCheckBoxPostpose.setBounds(new Rectangle(new Point(140, 330), jCheckBoxPostpose.getPreferredSize()));
    
            //---- jLabel12 ----
            jLabel12.setFont(new Font("Times New Roman", Font.BOLD, 11));
            jLabel12.setText("Pospos\u00e9");
            jLabel12.setRequestFocusEnabled(false);
            contentPane.add(jLabel12);
            jLabel12.setBounds(new Rectangle(new Point(20, 330), jLabel12.getPreferredSize()));
    
            //---- jCboPcActivity ----
            jCboPcActivity.setModel(new DefaultComboBoxModel<>(new String[] {
                "0",
                "10",
                "20",
                "30",
                "40",
                "50",
                "60",
                "70",
                "85",
                "90",
                "100"
            }));
            jCboPcActivity.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
            jCboPcActivity.addFocusListener(new FocusAdapter() {
                @Override
                public void focusLost(FocusEvent e) {
                    jCboPcActivityFocusLost(e);
                }
            });
            contentPane.add(jCboPcActivity);
            jCboPcActivity.setBounds(140, 180, jCboPcActivity.getPreferredSize().width, 20);
    
            //---- jCboTypeAbsence ----
            jCboTypeAbsence.setModel(new DefaultComboBoxModel<>(new String[] {
                "Item 1",
                "Item 2",
                "Item 3",
                "Item 4"
            }));
            contentPane.add(jCboTypeAbsence);
            jCboTypeAbsence.setBounds(new Rectangle(new Point(140, 210), jCboTypeAbsence.getPreferredSize()));
    
            //---- jCheckBoxVen1 ----
            jCheckBoxVen1.setText("Vendredi");
            jCheckBoxVen1.setIcon(new ImageIcon(getClass().getResource("/decisions/Oui.png")));
            jCheckBoxVen1.setSelectedIcon(new ImageIcon(getClass().getResource("/decisions/Non.png")));
            contentPane.add(jCheckBoxVen1);
            jCheckBoxVen1.setBounds(new Rectangle(new Point(395, 320), jCheckBoxVen1.getPreferredSize()));
            contentPane.add(TxtId);
            TxtId.setBounds(140, 40, 90, TxtId.getPreferredSize().height);
    
            //---- jDateChooserDebut ----
            jDateChooserDebut.setDateFormatString("dd-MMM-yyyy");
            jDateChooserDebut.setIcon(null);
            contentPane.add(jDateChooserDebut);
            jDateChooserDebut.setBounds(140, 240, 120, jDateChooserDebut.getPreferredSize().height);
    
            //---- jDateChooserFin ----
            jDateChooserFin.setDateFormatString("dd-MMM-yyyy");
            jDateChooserFin.setIcon(null);
            jDateChooserFin.setOpaque(false);
            jDateChooserFin.addPropertyChangeListener(e -> jDateChooserFinPropertyChange(e));
            contentPane.add(jDateChooserFin);
            jDateChooserFin.setBounds(140, 270, 120, jDateChooserFin.getPreferredSize().height);
    
            //---- DateDebutPostpose ----
            DateDebutPostpose.setDateFormatString("dd-MMM-yyyy");
            DateDebutPostpose.setIcon(null);
            DateDebutPostpose.setNextFocusableComponent(DateFinPostpose);
            DateDebutPostpose.setVisible(false);
            contentPane.add(DateDebutPostpose);
            DateDebutPostpose.setBounds(190, 330, 120, DateDebutPostpose.getPreferredSize().height);
    
            //---- jCheckBoxLun1 ----
            jCheckBoxLun1.setText("Lundi");
            jCheckBoxLun1.setIcon(new ImageIcon(getClass().getResource("/decisions/Oui.png")));
            jCheckBoxLun1.setSelectedIcon(new ImageIcon(getClass().getResource("/decisions/Non.png")));
            contentPane.add(jCheckBoxLun1);
            jCheckBoxLun1.setBounds(new Rectangle(new Point(395, 240), jCheckBoxLun1.getPreferredSize()));
    
            //---- jCheckBoxMar1 ----
            jCheckBoxMar1.setText("Mardi");
            jCheckBoxMar1.setIcon(new ImageIcon(getClass().getResource("/decisions/Oui.png")));
            jCheckBoxMar1.setSelectedIcon(new ImageIcon(getClass().getResource("/decisions/Non.png")));
            contentPane.add(jCheckBoxMar1);
            jCheckBoxMar1.setBounds(new Rectangle(new Point(395, 260), jCheckBoxMar1.getPreferredSize()));
    
            //---- jCheckBoxMer1 ----
            jCheckBoxMer1.setText("Mercredi");
            jCheckBoxMer1.setIcon(new ImageIcon(getClass().getResource("/decisions/Oui.png")));
            jCheckBoxMer1.setSelectedIcon(new ImageIcon(getClass().getResource("/decisions/Non.png")));
            contentPane.add(jCheckBoxMer1);
            jCheckBoxMer1.setBounds(new Rectangle(new Point(395, 280), jCheckBoxMer1.getPreferredSize()));
    
            //---- jCheckBoxJeu1 ----
            jCheckBoxJeu1.setText("Jeudi");
            jCheckBoxJeu1.setIcon(new ImageIcon(getClass().getResource("/decisions/Oui.png")));
            jCheckBoxJeu1.setSelectedIcon(new ImageIcon(getClass().getResource("/decisions/Non.png")));
            contentPane.add(jCheckBoxJeu1);
            jCheckBoxJeu1.setBounds(new Rectangle(new Point(395, 300), jCheckBoxJeu1.getPreferredSize()));
    
            //---- jCheckBoxVen2 ----
            jCheckBoxVen2.setText("Vendredi");
            jCheckBoxVen2.setIcon(new ImageIcon(getClass().getResource("/decisions/Oui.png")));
            jCheckBoxVen2.setSelectedIcon(new ImageIcon(getClass().getResource("/decisions/Non.png")));
            contentPane.add(jCheckBoxVen2);
            jCheckBoxVen2.setBounds(new Rectangle(new Point(475, 320), jCheckBoxVen2.getPreferredSize()));
    
            //---- jCheckBoxLun2 ----
            jCheckBoxLun2.setText("Lundi");
            jCheckBoxLun2.setIcon(new ImageIcon(getClass().getResource("/decisions/Oui.png")));
            jCheckBoxLun2.setSelectedIcon(new ImageIcon(getClass().getResource("/decisions/Non.png")));
            contentPane.add(jCheckBoxLun2);
            jCheckBoxLun2.setBounds(new Rectangle(new Point(475, 240), jCheckBoxLun2.getPreferredSize()));
    
            //---- jCheckBoxMar2 ----
            jCheckBoxMar2.setText("Mardi");
            jCheckBoxMar2.setIcon(new ImageIcon(getClass().getResource("/decisions/Oui.png")));
            jCheckBoxMar2.setSelectedIcon(new ImageIcon(getClass().getResource("/decisions/Non.png")));
            contentPane.add(jCheckBoxMar2);
            jCheckBoxMar2.setBounds(new Rectangle(new Point(475, 260), jCheckBoxMar2.getPreferredSize()));
    
            //---- jCheckBoxMer2 ----
            jCheckBoxMer2.setText("Mercredi");
            jCheckBoxMer2.setIcon(new ImageIcon(getClass().getResource("/decisions/Oui.png")));
            jCheckBoxMer2.setSelectedIcon(new ImageIcon(getClass().getResource("/decisions/Non.png")));
            contentPane.add(jCheckBoxMer2);
            jCheckBoxMer2.setBounds(new Rectangle(new Point(475, 280), jCheckBoxMer2.getPreferredSize()));
    
            //---- jCheckBoxJeu2 ----
            jCheckBoxJeu2.setText("Jeudi");
            jCheckBoxJeu2.setIcon(new ImageIcon(getClass().getResource("/decisions/Oui.png")));
            jCheckBoxJeu2.setSelectedIcon(new ImageIcon(getClass().getResource("/decisions/Non.png")));
            contentPane.add(jCheckBoxJeu2);
            jCheckBoxJeu2.setBounds(new Rectangle(new Point(440, 300), jCheckBoxJeu2.getPreferredSize()));
    
            //======== jScrollPane1 ========
            {
    
                //---- jTextAreaRemarques ----
                jTextAreaRemarques.setColumns(20);
                jTextAreaRemarques.setFont(new Font("Cambria", Font.PLAIN, 11));
                jTextAreaRemarques.setLineWrap(true);
                jTextAreaRemarques.setRows(5);
                jTextAreaRemarques.setCursor(Cursor.getPredefinedCursor(Cursor.SE_RESIZE_CURSOR));
                jScrollPane1.setViewportView(jTextAreaRemarques);
            }
            contentPane.add(jScrollPane1);
            jScrollPane1.setBounds(new Rectangle(new Point(150, 390), jScrollPane1.getPreferredSize()));
    
            //---- jLabel11 ----
            jLabel11.setFont(new Font("Times New Roman", Font.BOLD, 11));
            jLabel11.setText("Remarques :");
            contentPane.add(jLabel11);
            jLabel11.setBounds(21, 390, 70, jLabel11.getPreferredSize().height);
    
            //---- jCboFiliation ----
            jCboFiliation.setModel(new DefaultComboBoxModel<>(new String[] {
                " ",
                "Fils",
                "Fille",
                "P\u00e8re",
                "M\u00e8re",
                "Fr\u00e8re",
                "Soeur",
                "Beau-p\u00e8re",
                "Belle-m\u00e8re"
            }));
            jCboFiliation.addActionListener(e -> jCboFiliationActionPerformed(e));
            contentPane.add(jCboFiliation);
            jCboFiliation.setBounds(240, 210, 100, jCboFiliation.getPreferredSize().height);
            contentPane.add(jTextNom_Parent);
            jTextNom_Parent.setBounds(360, 210, 160, jTextNom_Parent.getPreferredSize().height);
    
            //---- jDateChooserDateDec ----
            jDateChooserDateDec.setDateFormatString("dd-MMM-yyyy");
            jDateChooserDateDec.setFocusCycleRoot(true);
            contentPane.add(jDateChooserDateDec);
            jDateChooserDateDec.setBounds(new Rectangle(new Point(140, 120), jDateChooserDateDec.getPreferredSize()));
    
            //---- jTextFieldNbrMois ----
            jTextFieldNbrMois.setBorder(new BevelBorder(BevelBorder.RAISED, Color.lightGray, Color.lightGray, null, null));
            jTextFieldNbrMois.setCaretColor(Color.gray);
            jTextFieldNbrMois.setMinimumSize(new Dimension(10, 20));
            jTextFieldNbrMois.setBackground(Color.white);
            contentPane.add(jTextFieldNbrMois);
            jTextFieldNbrMois.setBounds(265, 270, 135, jTextFieldNbrMois.getPreferredSize().height);
    
            { // compute preferred size
                Dimension preferredSize = new Dimension();
                for(int i = 0; i < contentPane.getComponentCount(); i++) {
                    Rectangle bounds = contentPane.getComponent(i).getBounds();
                    preferredSize.width = Math.max(bounds.x + bounds.width, preferredSize.width);
                    preferredSize.height = Math.max(bounds.y + bounds.height, preferredSize.height);
                }
                Insets insets = contentPane.getInsets();
                preferredSize.width += insets.right;
                preferredSize.height += insets.bottom;
                contentPane.setMinimumSize(preferredSize);
                contentPane.setPreferredSize(preferredSize);
            }
            pack();
            setLocationRelativeTo(getOwner());
        }// </editor-fold>//GEN-END:initComponents
    
        
        private void CmdSaveMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_CmdSaveMouseClicked
        
            conn = Connect.ConnectDB();
    try{
       jTextNom_Parent.setVisible(false);
    String sql = "Insert INTO Decisions (Id,DecId,Matr,Datedec,numero,Debut,Fin,Pourcent,AbsType,Refus,Postpose,Post_Debut,Post_Fin,Lu1,Ma1,Me1,Je1,Ve1,Lu2,Ma2,Me2,Je2,Ve2,Remarques,Filiation, Nom_Parent)VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
    //String sql1 = "Select type from typedossier)";
    PreparedStatement ps = conn.prepareStatement(sql);
    //PreparedStatement ps1 = conn.prepareStatement(sql1);
    ps.setString(1,TxtId.getText()); // à voir si tu dois utiliser ps.setInt()
    ps.setString(2,TxtDecId.getText());
    ps.setString(3,TxtMatr.getText());
    ps.setDate(4,new java.sql.Date(jDateChooserDateDec.getDate().getTime()));
    ps.setString(5,TxtNumero.getText());
    ps.setDate(6,new java.sql.Date(jDateChooserDebut.getDate().getTime()));
    ps.setDate(7,new java.sql.Date(jDateChooserFin.getDate().getTime()));
    ps.setObject(8, jCboPcActivity.getSelectedItem());
    ps.setObject(9,jCboTypeAbsence.getSelectedItem());
    ps.setObject(10, jCheckBoxRefus.isSelected());
    ps.setObject(11, jCheckBoxPostpose.isSelected());
    ps.setDate(12,new java.sql.Date(DateDebutPostpose.getDate().getTime()));
    ps.setDate(13,new java.sql.Date(DateFinPostpose.getDate().getTime()));
    ps.setObject(14, jCheckBoxLun1.isSelected());
    ps.setObject(15, jCheckBoxMar1.isSelected());
    ps.setObject(16, jCheckBoxMer1.isSelected());
    ps.setObject(17, jCheckBoxJeu1.isSelected());
    ps.setObject(18, jCheckBoxVen1.isSelected());
    ps.setObject(19, jCheckBoxLun2.isSelected());
    ps.setObject(20, jCheckBoxMar2.isSelected());
    ps.setObject(21, jCheckBoxMer2.isSelected());
    ps.setObject(22, jCheckBoxJeu2.isSelected());
    ps.setObject(23, jCheckBoxVen2.isSelected());
    ps.setString(24, jTextAreaRemarques.getText());
    ps.setObject(25, jCboFiliation.getSelectedItem());
    ps.setString(26, jTextNom_Parent.getText());
     ps.execute();
              JOptionPane.showMessageDialog(null, "Saved");
                conn.close();
    }
             catch(HeadlessException | SQLException e)
    {
                JOptionPane.showMessageDialog(null, e);
            }             
        }
    /*
        }//GEN-LAST:event_CmdSaveMouseClicked
    */
        private void jCboPcActivityFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_jCboPcActivityFocusLost
         
            String x = String.valueOf(jCboPcActivity.getSelectedItem());
            if (x.equals("100")) {
                
              jCheckBoxLun1.setSelected(true);
              jCheckBoxMar1.setSelected(true);
              jCheckBoxMer1.setSelected(true);
              jCheckBoxJeu1.setSelected(true);
              jCheckBoxVen1.setSelected(true);
              jCheckBoxLun2.setSelected(true);
              jCheckBoxMar2.setSelected(true);
              jCheckBoxMer2.setSelected(true);
              jCheckBoxJeu2.setSelected(true);
              jCheckBoxVen2.setSelected(true);
    
            } else {
              jCheckBoxLun1.setSelected(false);
              jCheckBoxMar1.setSelected(false);
              jCheckBoxMer1.setSelected(false);
              jCheckBoxJeu1.setSelected(false);
              jCheckBoxVen1.setSelected(false);
              jCheckBoxLun2.setSelected(false);
              jCheckBoxMar2.setSelected(false);
              jCheckBoxMer2.setSelected(false);
              jCheckBoxJeu2.setSelected(false);
              jCheckBoxVen2.setSelected(false);
              
            }
        //}
    
        }//GEN-LAST:event_jCboPcActivityFocusLost
    
        private void jCheckBoxPostposeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jCheckBoxPostposeActionPerformed
            if (jCheckBoxPostpose.isSelected()){
            DateFinPostpose.setVisible(true);
            DateDebutPostpose.setVisible(true);
            }
            else {
            DateFinPostpose.setVisible(false);
            DateDebutPostpose.setVisible(false);
            }
        }//GEN-LAST:event_jCheckBoxPostposeActionPerformed
    
    @SuppressWarnings("empty-statement")
        private void DateFinPostposePropertyChange(java.beans.PropertyChangeEvent evt) {//GEN-FIRST:event_DateFinPostposePropertyChange
                  DateFinPostpose.addPropertyChangeListener((java.beans.PropertyChangeEvent evt1) -> {
                      if (evt1.getPropertyName().equals("date")) {
                          if (DateDebutPostpose.getCalendar() == null) {
                              JOptionPane.showMessageDialog(null,
                                      "La date de début est nulle !!!.",
                                      " Avertissement", JOptionPane.WARNING_MESSAGE);;
                          } else {
                              if (DateFinPostpose.getCalendar().before(DateDebutPostpose.getCalendar())) {
                                  JOptionPane.showMessageDialog(null,
                                          "La date de début est inférieure à la date de fin !!!.",
                                          " Avertissement", JOptionPane.WARNING_MESSAGE);;
                              } else {
                                  System.out.println("bon d'accord ...");
                              }
                          }
                      }
                  });
               
        }//GEN-LAST:event_DateFinPostposePropertyChange
    
    @SuppressWarnings("empty-statement")
        private void jDateChooserFinPropertyChange(java.beans.PropertyChangeEvent evt) {//GEN-FIRST:event_jDateChooserFinPropertyChange
                          jDateChooserFin.addPropertyChangeListener(new PropertyChangeListener() {
                              @Override
                              public void propertyChange(java.beans.PropertyChangeEvent evt1) {
                                  if (evt1.getPropertyName().equals("date")) {
                                      if (jDateChooserDebut.getCalendar() == null) {
                                          JOptionPane.showMessageDialog(null,
                                                  "La date de début est nulle !!!.",
                                                  " Avertissement", JOptionPane.WARNING_MESSAGE);;
                                      } else
                                          
                                      {
                                          if (jDateChooserFin.getCalendar().before(jDateChooserDebut.getCalendar()))
                                          {
                                              JOptionPane.showMessageDialog(null,
                                                      "La date de début est "
                                                              + "supérieure à la date de fin !!!.",
                                                      " Avertissement", JOptionPane.WARNING_MESSAGE);;
                                          } else
                                              
                                          {
                                              System.out.println("bon d'accord ...");
                                          }                        }
                                  }
                                  {
                                      Calendar sDate = Calendar.getInstance();
                                      Calendar eDate = Calendar.getInstance();
                                      sDate.setTime(jDateChooserFin.getDate());
                                      eDate.setTime(jDateChooserDebut.getDate());
                                      int difInMonths = sDate.get(Calendar.MONTH) - eDate.get(Calendar.MONTH);
                                      JOptionPane.showMessageDialog(null,""+difInMonths+" mois","Nombre de mois !!!",JOptionPane.PLAIN_MESSAGE);
                                      System.out.println("Nbr de mois :"+difInMonths+"");
                                      
                                      String initialText = "Nbr de mois :"+difInMonths+"";
                                      jTextFieldNbrMois.setText(initialText);
                                  }
                              }
                          });
                                  // TODO add your handling code here:
        }//GEN-LAST:event_jDateChooserFinPropertyChange
    
        private void jCboFiliationActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jCboFiliationActionPerformed
        
            //String y = String.valueOf(jCboFiliation.getSelectedItem());
            
            if (jCboFiliation.getSelectedItem() == "<None>")
             {
              jTextNom_Parent.setVisible(false);
              } else 
            {
              jTextNom_Parent.setVisible(true);  
              }          // TODO add your handling code here:
        }//GEN-LAST:event_jCboFiliationActionPerformed
                                         
    
    /**
         * @param args the command line arguments
         */
    
    
        public static void main(String args[]) {
            //java.awt.EventQueue.invokeLater(new Runnable() {
            /* Set the Nimbus look and feel */
            //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
            /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
             * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
             */
            try {
                for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                    if ("Nimbus".equals(info.getName())) {
                        javax.swing.UIManager.setLookAndFeel(info.getClassName());
                        break;
                    }
                }
            } catch (ClassNotFoundException ex) {
                java.util.logging.Logger.getLogger(AddDecisionsJFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
            } catch (InstantiationException ex) {
                java.util.logging.Logger.getLogger(AddDecisionsJFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
            } catch (IllegalAccessException ex) {
                java.util.logging.Logger.getLogger(AddDecisionsJFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
            } catch (javax.swing.UnsupportedLookAndFeelException ex) {
                java.util.logging.Logger.getLogger(AddDecisionsJFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
            }
            //</editor-fold>
            //</editor-fold>
            //</editor-fold>
            //</editor-fold>
            //</editor-fold>
            //</editor-fold>
            //</editor-fold>
            //</editor-fold>
            //</editor-fold>
            //</editor-fold>
            //</editor-fold>
            //</editor-fold>
            //</editor-fold>
            //</editor-fold>
            //</editor-fold>
            //</editor-fold>
            //</editor-fold>
            //</editor-fold>
            //</editor-fold>
            //</editor-fold>
            //</editor-fold>
            //</editor-fold>
            //</editor-fold>
            //</editor-fold>
            //</editor-fold>
            //</editor-fold>
            //</editor-fold>
            //</editor-fold>
            //</editor-fold>
            //</editor-fold>
            //</editor-fold>
            //</editor-fold>
    
            
            /* Create and display the form */
            //java.awt.EventQueue.invokeLater(new Runnable() {
            java.awt.EventQueue.invokeLater(new Runnable() {
                @Override
                public void run() {
                    new AddDecisionsJFrame().setVisible(true);
                    
                }
    
                       public void actionPerformed(ActionEvent e) {
                           throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
                       }
            });
    }
    
        // Variables declaration - do not modify//GEN-BEGIN:variables
        // Generated using JFormDesigner non-commercial license
        private JLabel jLabel1;
        private JButton CmdSave;
        private JLabel jLabel2;
        private JTextField TxtDecId;
        private JLabel jLabel3;
        private JLabel jLabel4;
        private JTextField TxtNumero;
        private JLabel jLabel5;
        private JLabel jLabel6;
        private JLabel jLabel7;
        private JDateChooser DateFinPostpose;
        private JTextField TxtMatr;
        private JLabel jLabel8;
        private JLabel jLabel9;
        private JCheckBox jCheckBoxRefus;
        private JLabel jLabel10;
        private JCheckBox jCheckBox3;
        private JCheckBox jCheckBoxPostpose;
        private JLabel jLabel12;
        private JComboBox<String> jCboPcActivity;
        private JComboBox<String> jCboTypeAbsence;
        private JCheckBox jCheckBoxVen1;
        private JTextField TxtId;
        private JDateChooser jDateChooserDebut;
        private JDateChooser jDateChooserFin;
        private JDateChooser DateDebutPostpose;
        private JCheckBox jCheckBoxLun1;
        private JCheckBox jCheckBoxMar1;
        private JCheckBox jCheckBoxMer1;
        private JCheckBox jCheckBoxJeu1;
        private JCheckBox jCheckBoxVen2;
        private JCheckBox jCheckBoxLun2;
        private JCheckBox jCheckBoxMar2;
        private JCheckBox jCheckBoxMer2;
        private JCheckBox jCheckBoxJeu2;
        private JScrollPane jScrollPane1;
        private JTextArea jTextAreaRemarques;
        private JLabel jLabel11;
        private JComboBox<String> jCboFiliation;
        private JTextField jTextNom_Parent;
        private JDateChooser jDateChooserDateDec;
        private JTextField jTextFieldNbrMois;
        // End of variables declaration//GEN-END:variables
      
    }

  6. #6
    Modérateur

    Homme Profil pro
    Développeur java, access, sql server
    Inscrit en
    Octobre 2005
    Messages
    2 710
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Val de Marne (Île de France)

    Informations professionnelles :
    Activité : Développeur java, access, sql server
    Secteur : Industrie

    Informations forums :
    Inscription : Octobre 2005
    Messages : 2 710
    Points : 4 794
    Points
    4 794
    Par défaut
    Si tu as ta classe AddDecisionsJFrame affichée dans ton éditeur
    et que tu cliques au milieu de la classe, le bouton "run file" (Ctrl+F6) est toujours grisé ?

    Car si ta classe n'est pas sélectionnée, le bouton est grisé
    Labor improbus omnia vincit un travail acharné vient à bout de tout - Ambroise Paré (1510-1590)

    Consulter sans modération la FAQ ainsi que les bons ouvrages : http://jmdoudoux.developpez.com/cours/developpons/java/

  7. #7
    Membre habitué
    Profil pro
    Inscrit en
    Janvier 2009
    Messages
    469
    Détails du profil
    Informations personnelles :
    Localisation : Belgique

    Informations forums :
    Inscription : Janvier 2009
    Messages : 469
    Points : 149
    Points
    149
    Par défaut
    Oui,

    En fait les problemes ont debutes lorsque j ai commence a utiler jFormdesigner>

    Habiler

  8. #8
    Modérateur

    Homme Profil pro
    Développeur java, access, sql server
    Inscrit en
    Octobre 2005
    Messages
    2 710
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Val de Marne (Île de France)

    Informations professionnelles :
    Activité : Développeur java, access, sql server
    Secteur : Industrie

    Informations forums :
    Inscription : Octobre 2005
    Messages : 2 710
    Points : 4 794
    Points
    4 794
    Par défaut
    Et si tu crées un nouveau Jframe tu as toujours le même problème ?
    Si c'est le cas, il faut peut-être réinstaller NetBeans
    Labor improbus omnia vincit un travail acharné vient à bout de tout - Ambroise Paré (1510-1590)

    Consulter sans modération la FAQ ainsi que les bons ouvrages : http://jmdoudoux.developpez.com/cours/developpons/java/

  9. #9
    Membre habitué
    Profil pro
    Inscrit en
    Janvier 2009
    Messages
    469
    Détails du profil
    Informations personnelles :
    Localisation : Belgique

    Informations forums :
    Inscription : Janvier 2009
    Messages : 469
    Points : 149
    Points
    149
    Par défaut
    je suis egalement paase a netbeans 8.2.

    Ferai les tests avec 8.1.

    Merci

    Habiler

  10. #10
    Membre habitué
    Profil pro
    Inscrit en
    Janvier 2009
    Messages
    469
    Détails du profil
    Informations personnelles :
    Localisation : Belgique

    Informations forums :
    Inscription : Janvier 2009
    Messages : 469
    Points : 149
    Points
    149
    Par défaut
    Apparemment en 8.1 cela refonctionne normalement.


    Habiler

  11. #11
    Modérateur

    Homme Profil pro
    Développeur java, access, sql server
    Inscrit en
    Octobre 2005
    Messages
    2 710
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Val de Marne (Île de France)

    Informations professionnelles :
    Activité : Développeur java, access, sql server
    Secteur : Industrie

    Informations forums :
    Inscription : Octobre 2005
    Messages : 2 710
    Points : 4 794
    Points
    4 794
    Par défaut
    A la bonne heure !
    Labor improbus omnia vincit un travail acharné vient à bout de tout - Ambroise Paré (1510-1590)

    Consulter sans modération la FAQ ainsi que les bons ouvrages : http://jmdoudoux.developpez.com/cours/developpons/java/

Discussions similaires

  1. Do you want to run or save this file ?
    Par laurentSc dans le forum Balisage (X)HTML et validation W3C
    Réponses: 4
    Dernier message: 07/12/2011, 23h01
  2. Réponses: 2
    Dernier message: 04/03/2003, 23h24
  3. recupèrer file d'attente d'impression
    Par magic corp. dans le forum Langage
    Réponses: 2
    Dernier message: 25/09/2002, 14h12

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