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

AWT/Swing Java Discussion :

Exception levée au moment d'appeler une fenêtre


Sujet :

AWT/Swing Java

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre averti
    Profil pro
    Étudiant
    Inscrit en
    Septembre 2009
    Messages
    24
    Détails du profil
    Informations personnelles :
    Âge : 38
    Localisation : France

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Septembre 2009
    Messages : 24
    Par défaut Exception levée au moment d'appeler une fenêtre
    Bonjour à tous,
    Dans le cadre de mon BTS, j'ai un projet java MVC à réaliser.
    jusqu'à la tout va bien.
    seulement, j'ai un petit soucis au niveau de mon interface d'accueil :
    elle ressemble à ça :


    lorsque je clique sur "Editer / supprimer un vol" une fenêtre doit s'ouvrir, voici un exemple :

    (ne pas tenir compte de la présentation, je réglerais ses détails à la fin )

    voila, donc lorsque je clique sur ce bouton, j'ai une exception qui est levée:
    actionPerformed()
    Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
    at controleur.CtrlGUISupprModVol.initListeVols(CtrlGUISupprModVol.java:34)
    at controleur.CtrlGUISupprModVol.<init>(CtrlGUISupprModVol.java:26)
    at vue.GUIAccueil$3.actionPerformed(GUIAccueil.java:160)
    at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
    at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
    at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
    at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
    at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
    at java.awt.Component.processMouseEvent(Unknown Source)
    at javax.swing.JComponent.processMouseEvent(Unknown Source)
    at java.awt.Component.processEvent(Unknown Source)
    at java.awt.Container.processEvent(Unknown Source)
    at java.awt.Component.dispatchEventImpl(Unknown Source)
    at java.awt.Container.dispatchEventImpl(Unknown Source)
    at java.awt.Component.dispatchEvent(Unknown Source)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
    at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
    at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
    at java.awt.Container.dispatchEventImpl(Unknown Source)
    at java.awt.Window.dispatchEventImpl(Unknown Source)
    at java.awt.Component.dispatchEvent(Unknown Source)
    at java.awt.EventQueue.dispatchEvent(Unknown Source)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.run(Unknown Source)

    donc, je pense que cela vient du fait que pour initialiser cette fenêtre, une requête SQL doit être faite, mais je ne voit pas comment appeler cette fenêtre à partir de la fenêtre d'accueil!

    je vous laisse ici le code d'appel
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    private JButton getBtnSurrprModVol() {
    		if (btnSurrprModVol == null) {
    			btnSurrprModVol = new JButton();
    			btnSurrprModVol.setBounds(new Rectangle(24, 180, 218, 33));
    			btnSurrprModVol.setText("Editer / supprimer un vol");
    			btnSurrprModVol.addActionListener(new java.awt.event.ActionListener() {
    				public void actionPerformed(java.awt.event.ActionEvent e) {
    					System.out.println("actionPerformed()"); // TODO Auto-generated Event stub actionPerformed()
    					new CtrlGUISupprModVol(maBdd);
    				}
    			});
    		}
    		return btnSurrprModVol;
    	}

    puis le code du controleur de la fenetre supprimer/modifier :
    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
    package controleur;
     
    import java.sql.ResultSet;
    import java.sql.SQLException;
    import java.util.ArrayList;
     
    import javax.swing.DefaultComboBoxModel;
     
    import modele.Aerogare;
    import modele.Vol;
     
    import util.Bdd;
    import vue.GUISupprModVol;
     
    public class CtrlGUISupprModVol {
    	private Bdd maBdd;
    	private GUISupprModVol gUISupprModVol;
    	private DefaultComboBoxModel listeVols;
    	private DefaultComboBoxModel listeNumVols;
     
    	public CtrlGUISupprModVol(Bdd maBdd) {
    		super();
    		this.maBdd = maBdd;
    		this.listeVols = new DefaultComboBoxModel();
    		this.listeNumVols = new DefaultComboBoxModel();
    		this.initListeVols();
    		this.gUISupprModVol = new GUISupprModVol(this);
    		this.initVue();
    		this.gUISupprModVol.setVisible(true);
    	}
     
    	public void initListeVols ()
    	{
    		ResultSet rsListeVols = maBdd.listeVol();
    		try 
    		{
    			String numVol = "";
    				String dateD = "";
    				String dateA = "";
    				String heureD = "";
    				String heureA = "";
     
    				float prix=0;
    				Vol vol = null;
    				int numAeroD;
    				String nomAeroD = null;				
    				String villeAeroD = null;				
    				int numAeroA;
    				String nomAeroA = null;				
    				String villeAeroA = null;				
     
    			while (rsListeVols.next()) 
    			{
     
    				System.out.println(dateD);
    				numVol = rsListeVols.getString("numVol");
    				dateD = rsListeVols.getString("dateDepart");
    				dateA = rsListeVols.getString("dateArrivee");
    				heureD = rsListeVols.getString("heureDepart");
    				heureA = rsListeVols.getString("heureArrivee");
    				numAeroD = rsListeVols.getInt("a1.num");
    				nomAeroD = rsListeVols.getString("a1.nom");				
    				villeAeroD = rsListeVols.getString("a1.ville");				
    				numAeroA = rsListeVols.getInt("a2.num");
    				nomAeroA = rsListeVols.getString("a2.nom");				
    				villeAeroA = rsListeVols.getString("a2.ville");				
     
    				prix = rsListeVols.getFloat("prix");
     
    				vol = new Vol(numVol, dateD, heureD, new Aerogare( numAeroD, nomAeroD, villeAeroD), dateA,  heureA, new Aerogare( numAeroA, nomAeroA, villeAeroA), prix);
    				listeVols.addElement(vol);
    				listeNumVols.addElement(vol.getNumVol());
    			}
    		}catch (SQLException e)
    		{
     
    		}
    	}
     
    	public void initVue ()
    	{
    			int nbVols = listeVols.getSize();
    			Vol v;
    			for (int i = 0 ; i < nbVols ; i++)
    			{
    				String numVol = "";
    				String dateD = "";
    				String dateA = "";
    				String heureD = "";
    				String heureA = "";
    				String aeroD = "";
    				String aeroA = "";
    				String prix = "";
    				System.out.println(dateD);
    				v = (Vol) listeVols.getElementAt(i);
    //				dateD = listeVols.getString("dateDepart");
    //				dateA = listeVols.getString("dateArrivee");
    //				heureD = listeVols.getString("heureDepart");
    //				heureA = listeVols.getString("heureArrivee");
    //				aeroD = listeVols.getString("a1.nom");
    //				aeroA = listeVols.getString("a2.nom");
    //				prix = listeVols.getString("prix");
     
    //				gUISupprModVol.getComboBoxNumVol().addItem(v.getNumVol());
    				System.out.println("test");
    			}
     
    			gUISupprModVol.getLblDateDep().setText(((Vol) listeVols.getElementAt(0)).getDateDepart());
    			gUISupprModVol.getLblDateArr().setText(((Vol) listeVols.getElementAt(0)).getDateArrivee());
    			gUISupprModVol.getLblAeroDep().setText(((Vol) listeVols.getElementAt(0)).getAerogareDepart().getNom());
    			gUISupprModVol.getLblValHeureDep().setText(((Vol) listeVols.getElementAt(0)).getHeureDepart());
    			gUISupprModVol.getLblAeroArr().setText(((Vol) listeVols.getElementAt(0)).getAerogareArrivee().getNom());
    			gUISupprModVol.getLblValHeureArr().setText(((Vol) listeVols.getElementAt(0)).getHeureArrivee());	
    			gUISupprModVol.getLblValPrix().setText(Float.toString(((Vol) listeVols.getElementAt(0)).getPrix()));
     
     
    	}
     
     
    	public void changeVol (int i)
    	{
    		gUISupprModVol.getLblDateDep().setText(((Vol) listeVols.getElementAt(i)).getDateDepart());
    		gUISupprModVol.getLblDateArr().setText(((Vol) listeVols.getElementAt(i)).getDateArrivee());
    		gUISupprModVol.getLblAeroDep().setText(((Vol) listeVols.getElementAt(i)).getAerogareDepart().getNom());
    		gUISupprModVol.getLblValHeureDep().setText(((Vol) listeVols.getElementAt(i)).getHeureDepart());
    		gUISupprModVol.getLblAeroArr().setText(((Vol) listeVols.getElementAt(i)).getAerogareArrivee().getNom());
    		gUISupprModVol.getLblValHeureArr().setText(((Vol) listeVols.getElementAt(i)).getHeureArrivee());	
    		gUISupprModVol.getLblValPrix().setText(Float.toString(((Vol) listeVols.getElementAt(i)).getPrix()));
     
    	}
     
    	public void supprimerVol (int i)
    	{
    		System.out.println(i);
    		System.out.println(((Vol) listeVols.getElementAt(i)).getNumVol());
    		maBdd.supprimerVol((String)(listeNumVols.getElementAt(i)));
    		listeVols.removeElementAt(i);
    		listeNumVols.removeElementAt(i);
    	}
     
    	public Bdd getMaBdd() {
    		return maBdd;
    	}
     
    	public void setMaBdd(Bdd maBdd) {
    		this.maBdd = maBdd;
    	}
     
    	public GUISupprModVol getgUISupprModVol() {
    		return gUISupprModVol;
    	}
     
    	public void setgUISupprModVol(GUISupprModVol gUISupprModVol) {
    		this.gUISupprModVol = gUISupprModVol;
    	}
     
    	public DefaultComboBoxModel getListeVols() {
    		return listeVols;
    	}
     
    	public void setListeVols(DefaultComboBoxModel listeVols) {
    		this.listeVols = listeVols;
    	}
     
    	public DefaultComboBoxModel getListeNumVols() {
    		return listeNumVols;
    	}
     
    	public void setListeNumVols(DefaultComboBoxModel listeNumVols) {
    		this.listeNumVols = listeNumVols;
    	}
    }
    puis le code de la fenêtre appelée :
    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
    package vue;
     
    import java.awt.BorderLayout;
    import javax.swing.JPanel;
    import javax.swing.JFrame;
    import java.awt.Dimension;
    import javax.swing.BoxLayout;
    import java.awt.GridBagLayout;
    import javax.swing.JLabel;
    import java.awt.GridBagConstraints;
    import java.awt.Rectangle;
    import javax.swing.JComboBox;
    import javax.swing.BorderFactory;
    import javax.swing.border.TitledBorder;
    import java.awt.Font;
    import java.awt.Color;
    import javax.swing.JButton;
     
    import controleur.CtrlGUISupprModVol;
     
    public class GUISupprModVol extends JFrame {
     
    	private static final long serialVersionUID = 1L;
    	private JPanel jContentPane = null;
    	private JLabel lblNumVol = null;
    	private JComboBox comboBoxNumVol = null;
    	private JPanel pnlSelectVol = null;
    	private JPanel pnlPropVol = null;
    	private JLabel lblDu = null;
    	private JLabel lblDateDep = null;
    	private JLabel lblAu = null;
    	private JLabel lblDateArr = null;
    	private JLabel lblDepartDe = null;
    	private JLabel lblValHeureDep = null;
    	private JLabel lblArriveeA = null;
    	private JLabel lblValHeureArr = null;
    	private JLabel lblPrix = null;
    	private JLabel lblValPrix = null;
    	private JLabel lblEuro = null;
    	private JLabel lblAeroDep = null;
    	private JLabel lblA = null;
    	private JLabel lblAeroArr = null;
    	private JLabel lblA2 = null;
    	private JButton btnSuppr = null;
    	private JButton btnEditer = null;
    	private CtrlGUISupprModVol ctrlGUISupprModVol;  //  @jve:decl-index=0:
     
     
    	public GUISupprModVol(CtrlGUISupprModVol ctrlGUISupprModVol) {
    		super();
    		this.ctrlGUISupprModVol = ctrlGUISupprModVol;
    		initialize();
    	}
     
    	public void setComboBoxNumVol(JComboBox comboBoxNumVol) {
    		this.comboBoxNumVol = comboBoxNumVol;
     
    	}
     
    	/**
             * This method initializes this
             * 
             * @return void
             */
    	private void initialize() {
    		this.setSize(373, 367);
    		this.setContentPane(getJContentPane());
    		this.setTitle("Supprimer un vol");
    	}
     
    	/**
             * This method initializes jContentPane
             * 
             * @return javax.swing.JPanel
             */
    	private JPanel getJContentPane() {
    		if (jContentPane == null) {
    			lblNumVol = new JLabel();
    			lblNumVol.setText("Numéro Vol :");
    			lblNumVol.setBounds(new Rectangle(11, 26, 86, 19));
    			jContentPane = new JPanel();
    			jContentPane.setLayout(null);
    			jContentPane.add(getPnlSelectVol(), null);
    			jContentPane.add(getPnlPropVol(), null);
    			jContentPane.add(getBtnSuppr(), null);
    			jContentPane.add(getBtnEditer(), null);
    		}
    		return jContentPane;
    	}
     
    	/**
             * This method initializes ComboBoxNumVol       
             *      
             * @return javax.swing.JComboBox        
             */
    	public JComboBox getComboBoxNumVol() {
    		if (comboBoxNumVol == null) {
    			comboBoxNumVol = new JComboBox();
    			comboBoxNumVol.setBounds(new Rectangle(111, 25, 126, 19));
    			comboBoxNumVol.setModel(ctrlGUISupprModVol.getListeNumVols());
    			this.comboBoxNumVol.addActionListener(new java.awt.event.ActionListener() {
    				public void actionPerformed(java.awt.event.ActionEvent e) {
    					System.out.println("actionPerformed()");
    					changeVol();
    				}
    			});
    		}
    		return comboBoxNumVol;
    	}
     
    	/**
             * This method initializes pnlSelectVol 
             *      
             * @return javax.swing.JPanel   
             */
    	private JPanel getPnlSelectVol() {
    		if (pnlSelectVol == null) {
    			pnlSelectVol = new JPanel();
    			pnlSelectVol.setLayout(null);
    			pnlSelectVol.setBounds(new Rectangle(5, 22, 339, 56));
    			pnlSelectVol.setName("Sélection Vol");
    			pnlSelectVol.setToolTipText("");
    			pnlSelectVol.setBorder(BorderFactory.createTitledBorder(null, "Séléction d\'un vol", TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.DEFAULT_POSITION, new Font("Dialog", Font.BOLD, 12), new Color(51, 51, 51)));
    			pnlSelectVol.add(lblNumVol, null);
    			pnlSelectVol.add(getComboBoxNumVol(), null);
    		}
    		return pnlSelectVol;
    	}
     
    	/**
             * This method initializes pnlPropVol   
             *      
             * @return javax.swing.JPanel   
             */
    	private JPanel getPnlPropVol() {
    		if (pnlPropVol == null) {
    			lblA2 = new JLabel();
    			lblA2.setBounds(new Rectangle(190, 91, 21, 20));
    			lblA2.setText("à");
    			lblAeroArr = new JLabel();
    			lblAeroArr.setBounds(new Rectangle(78, 91, 98, 20));
    			lblAeroArr.setText("xxxx - xxxx");
    			lblA = new JLabel();
    			lblA.setBounds(new Rectangle(201, 60, 13, 16));
    			lblA.setText("à");
    			lblAeroDep = new JLabel();
    			lblAeroDep.setBounds(new Rectangle(99, 60, 92, 16));
    			lblAeroDep.setText("xxxx - xxxx");
    			lblEuro = new JLabel();
    			lblEuro.setBounds(new Rectangle(152, 124, 20, 18));
    			lblEuro.setText("€");
    			lblValPrix = new JLabel();
    			lblValPrix.setBounds(new Rectangle(67, 125, 67, 17));
    			lblValPrix.setText("xxxxx");
    			lblPrix = new JLabel();
    			lblPrix.setBounds(new Rectangle(14, 124, 42, 16));
    			lblPrix.setText("Prix :");
    			lblValHeureArr = new JLabel();
    			lblValHeureArr.setBounds(new Rectangle(224, 90, 72, 21));
    			lblValHeureArr.setText("xxHxx");
    			lblArriveeA = new JLabel();
    			lblArriveeA.setBounds(new Rectangle(8, 91, 64, 20));
    			lblArriveeA.setText("Arrivée à :");
    			lblValHeureDep = new JLabel();
    			lblValHeureDep.setBounds(new Rectangle(233, 59, 58, 17));
    			lblValHeureDep.setText("xxHxx");
    			lblDepartDe = new JLabel();
    			lblDepartDe.setBounds(new Rectangle(14, 60, 71, 17));
    			lblDepartDe.setText("Départ de :");
    			lblDateArr = new JLabel();
    			lblDateArr.setBounds(new Rectangle(212, 31, 83, 16));
    			lblDateArr.setText("xxxx-xx-xx");
    			lblAu = new JLabel();
    			lblAu.setBounds(new Rectangle(151, 30, 38, 16));
    			lblAu.setText("Au");
    			lblDateDep = new JLabel();
    			lblDateDep.setBounds(new Rectangle(55, 28, 77, 17));
    			lblDateDep.setText("xxxx-xx-xx");
    			lblDu = new JLabel();
    			lblDu.setBounds(new Rectangle(14, 29, 25, 17));
    			lblDu.setText("Du");
    			pnlPropVol = new JPanel();
    			pnlPropVol.setLayout(null);
    			pnlPropVol.setBounds(new Rectangle(8, 88, 336, 153));
    			pnlPropVol.setBorder(BorderFactory.createTitledBorder(null, "Propriété du vol", TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.DEFAULT_POSITION, new Font("Dialog", Font.BOLD, 12), new Color(51, 51, 51)));
    			pnlPropVol.add(lblDu, null);
    			pnlPropVol.add(lblDateDep, null);
    			pnlPropVol.add(lblAu, null);
    			pnlPropVol.add(lblDateArr, null);
    			pnlPropVol.add(lblDepartDe, null);
    			pnlPropVol.add(lblAeroDep, null);
    			pnlPropVol.add(lblA, null);
    			pnlPropVol.add(lblValHeureDep, null);
    			pnlPropVol.add(lblArriveeA, null);
    			pnlPropVol.add(lblAeroArr, null);
    			pnlPropVol.add(lblA2, null);
    			pnlPropVol.add(lblValHeureArr, null);
    			pnlPropVol.add(lblPrix, null);
    			pnlPropVol.add(lblValPrix, null);
    			pnlPropVol.add(lblEuro, null);
    		}
    		return pnlPropVol;
    	}
     
    	public JPanel getjContentPane() {
    		return jContentPane;
    	}
     
    	public void setjContentPane(JPanel jContentPane) {
    		this.jContentPane = jContentPane;
    	}
     
    	public JLabel getLblNumVol() {
    		return lblNumVol;
    	}
     
    	public void setLblNumVol(JLabel lblNumVol) {
    		this.lblNumVol = lblNumVol;
    	}
     
    	public JLabel getLblDu() {
    		return lblDu;
    	}
     
    	public void setLblDu(JLabel lblDu) {
    		this.lblDu = lblDu;
    	}
     
    	public JLabel getLblDateDep() {
    		return lblDateDep;
    	}
     
    	public void setLblDateDep(JLabel lblDateDep) {
    		this.lblDateDep = lblDateDep;
    	}
     
    	public JLabel getLblAu() {
    		return lblAu;
    	}
     
    	public void setLblAu(JLabel lblAu) {
    		this.lblAu = lblAu;
    	}
     
    	public JLabel getLblDateArr() {
    		return lblDateArr;
    	}
     
    	public void setLblDateArr(JLabel lblDateArr) {
    		this.lblDateArr = lblDateArr;
    	}
     
    	public JLabel getLblDepartDe() {
    		return lblDepartDe;
    	}
     
    	public void setLblDepartDe(JLabel lblDepartDe) {
    		this.lblDepartDe = lblDepartDe;
    	}
     
    	public JLabel getLblValHeureDep() {
    		return lblValHeureDep;
    	}
     
    	public void setLblValHeureDep(JLabel lblValHeureDep) {
    		this.lblValHeureDep = lblValHeureDep;
    	}
     
    	public JLabel getLblArriveeA() {
    		return lblArriveeA;
    	}
     
    	public void setLblArriveeA(JLabel lblArriveeA) {
    		this.lblArriveeA = lblArriveeA;
    	}
     
    	public JLabel getLblValHeureArr() {
    		return lblValHeureArr;
    	}
     
    	public void setLblValHeureArr(JLabel lblValHeureArr) {
    		this.lblValHeureArr = lblValHeureArr;
    	}
     
    	public JLabel getLblPrix() {
    		return lblPrix;
    	}
     
    	public void setLblPrix(JLabel lblPrix) {
    		this.lblPrix = lblPrix;
    	}
     
    	public JLabel getLblValPrix() {
    		return lblValPrix;
    	}
     
    	public void setLblValPrix(JLabel lblValPrix) {
    		this.lblValPrix = lblValPrix;
    	}
     
    	public JLabel getLblEuro() {
    		return lblEuro;
    	}
     
    	public void setLblEuro(JLabel lblEuro) {
    		this.lblEuro = lblEuro;
    	}
     
    	public JLabel getLblAeroDep() {
    		return lblAeroDep;
    	}
     
    	public void setLblAeroDep(JLabel lblAeroDep) {
    		this.lblAeroDep = lblAeroDep;
    	}
     
    	public JLabel getLblA() {
    		return lblA;
    	}
     
    	public void setLblA(JLabel lblA) {
    		this.lblA = lblA;
    	}
     
    	public JLabel getLblAeroArr() {
    		return lblAeroArr;
    	}
     
    	public void setLblAeroArr(JLabel lblAeroArr) {
    		this.lblAeroArr = lblAeroArr;
    	}
     
    	public JLabel getLblA2() {
    		return lblA2;
    	}
     
    	public void setLblA2(JLabel lblA2) {
    		this.lblA2 = lblA2;
    	}
     
    	public CtrlGUISupprModVol getCtrlGUISupprModVol() {
    		return ctrlGUISupprModVol;
    	}
     
    	public void setCtrlGUISupprModVol(CtrlGUISupprModVol ctrlGUISupprModVol) {
    		this.ctrlGUISupprModVol = ctrlGUISupprModVol;
    	}
     
    	public static long getSerialversionuid() {
    		return serialVersionUID;
    	}
     
    	public void setPnlSelectVol(JPanel pnlSelectVol) {
    		this.pnlSelectVol = pnlSelectVol;
    	}
     
    	public void setPnlPropVol(JPanel pnlPropVol) {
    		this.pnlPropVol = pnlPropVol;
    	}
     
    	public void setBtnSuppr(JButton btnSuppr) {
    		this.btnSuppr = btnSuppr;
    	}
     
    	public void setBtnEditer(JButton btnEditer) {
    		this.btnEditer = btnEditer;
    	}
     
    	/**
             * This method initializes btnSuppr     
             *      
             * @return javax.swing.JButton  
             */
    	private JButton getBtnSuppr() {
    		if (btnSuppr == null) {
    			btnSuppr = new JButton();
    			btnSuppr.setBounds(new Rectangle(15, 258, 128, 26));
    			btnSuppr.setText("Supprimer");
    			btnSuppr.addActionListener(new java.awt.event.ActionListener() {
    				public void actionPerformed(java.awt.event.ActionEvent e) {
    					System.out.println("actionPerformed()");
    					supprimerVol();// TODO Auto-generated Event stub actionPerformed()
    				}
    			});
    		}
    		return btnSuppr;
    	}
     
    	/**
             * This method initializes btnEditer    
             *      
             * @return javax.swing.JButton  
             */
    	private JButton getBtnEditer() {
    		if (btnEditer == null) {
    			btnEditer = new JButton();
    			btnEditer.setBounds(new Rectangle(215, 258, 128, 26));
    			btnEditer.setText("Editer");
    		}
    		return btnEditer;
    	}
     
    	private void changeVol() {
    		ctrlGUISupprModVol.changeVol(comboBoxNumVol.getSelectedIndex());
    	}
     
    	private void supprimerVol() {
    		ctrlGUISupprModVol.supprimerVol(comboBoxNumVol.getSelectedIndex());
    	}
    }  //  @jve:decl-index=0:visual-constraint="10,10"
    PS : je précise que quand je lance la fenêtre GUISuprModVol à partir d'une classe Lancement.java, l'initialisation se fait correctement (voir screen un peu plus haut)
    voici le code qui lance la fenêtre :
    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
    public Lancement () {
    		initParametre();
    		maBdd = new Bdd();
    		try {
    			maBdd.connecter(user, password);
    			System.out.println("connexion réussie");
    			//CtrlGUIAerogare ctrlGUIAerogare = new CtrlGUIAerogare(maBdd);
    			//CtrlGUICreationVol crtlGuiCreationVol = new CtrlGUICreationVol (maBdd);
    			CtrlGUISupprModVol ctrlGUISupprModVol = new CtrlGUISupprModVol (maBdd);
    			//CtrlGUIAjoutAero ctrlGUIAjoutAero = new CtrlGUIAjoutAero (maBdd);
    		} catch (ClassNotFoundException e) {
    			e.printStackTrace();
    		} catch (SQLException e) {
    			e.printStackTrace();
    		} finally {
    //			try {
    //				maBdd.fermer();
    //			} catch (SQLException e) {
    //				e.printStackTrace();
    //			}
    		}
    	}
    voila, donc si vous avez un petit conseil...je suis tout ouïe,
    merci d'avance, Fred!

  2. #2
    Membre expérimenté
    Profil pro
    Inscrit en
    Janvier 2005
    Messages
    179
    Détails du profil
    Informations personnelles :
    Localisation : France, Paris (Île de France)

    Informations forums :
    Inscription : Janvier 2005
    Messages : 179
    Par défaut
    Si j'en crois la trace :
    Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
    at controleur.CtrlGUISupprModVol.initListeVols(CtrlGUISupprModVol.java:34)
    Tu as un pointeur null à la ligne 34 du fichier CtrlGUISupprModVol.java, ce qui semble correspondre à cette ligne :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    ResultSet rsListeVols = maBdd.listeVol();
    J'en conclu donc que maBdd est à null...

    Fred.

  3. #3
    Membre averti
    Profil pro
    Étudiant
    Inscrit en
    Septembre 2009
    Messages
    24
    Détails du profil
    Informations personnelles :
    Âge : 38
    Localisation : France

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Septembre 2009
    Messages : 24
    Par défaut [RESOLUE]
    ça j'avais compris ^^
    ce que je demandais c'est comment faire pour ouvrir la fenêtre sachant qu'il fallait appeler aussi le contrôleur de cette fenêtre!!

    en fait j'ai compris l'erreur, j'ai résolu ça tout seul comme un grand...Mais 2heures après...^^

    en fait, je voulais faire les appel à autres fenêtre directement à partir de l'actionperformed sauf que ça devait foiré à cause du fait que je devais initialiser ma vue avec des données de la BD.
    du coup, j'ai créer un contrôleur de ma vue d'accueil qui gère les appels des mes autres vues...
    voila!!!

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

Discussions similaires

  1. Appellé une fenêtre.
    Par corgato dans le forum Qt
    Réponses: 32
    Dernier message: 03/04/2008, 11h47
  2. Réponses: 4
    Dernier message: 04/04/2007, 10h37
  3. Réponses: 12
    Dernier message: 03/03/2007, 00h52
  4. [C#] Comment appeler une fenêtre modale dans un autre thread ?
    Par Pilloutou dans le forum Windows Forms
    Réponses: 6
    Dernier message: 05/10/2006, 11h19
  5. Appeler une fenêtre DOS en arrière-plan
    Par Efpoint dans le forum VB 6 et antérieur
    Réponses: 1
    Dernier message: 29/09/2006, 10h00

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