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 :

Problème lancement multiple d'une méthode


Sujet :

AWT/Swing Java

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre confirmé
    Homme Profil pro
    Développeur Java
    Inscrit en
    Mai 2011
    Messages
    74
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Calvados (Basse Normandie)

    Informations professionnelles :
    Activité : Développeur Java
    Secteur : Bâtiment

    Informations forums :
    Inscription : Mai 2011
    Messages : 74
    Par défaut Problème lancement multiple d'une méthode
    Bonjour à tous.

    Actuellement débutant en java à l'Afpa, je suis en train de réaliser une petite application de gestion de bibliothèque. Bien évidemment, j'ai un problème.

    Je vais essayer de le résumer le plus simplement possible.

    J'ai une classe principale(l'acceuil), qui appelle elle même par 3 boutons 3 autres classes (Rechercher, Emprunter, Restituer).
    Dans mon panneau Rechercher, j'affiche un bouton(payer cotisation) qui ouvre un JDialog.
    Mon problème, c'est que si j'ai été avant x fois sur le panneau rechercher, quand je clique sur le bouton pour payer la cotis, il m'ouvre x JDialog superposé. Comme si j'avais appuyé x fois sur ce maudit bouton. Je ne pense pas que le bouton soit la cause, ni les listeners, après pas mal de tests, tout me semble correct.
    Je pense plutôt pour un problème d'appel de classe. Tout se passe comme si mon programme gardait en mémoire le nombre de fois que je les ai appelé, ce qui fait que quand je déclenche une action, il déclenche cette action plusieurs fois!
    Notre formateur étant actuellement malade pour encore 2 semaines, inutile de dire que je suis livré à moi même.
    J'ai eu beau chercher sur pas mal de forums, j'ai rien trouvé(soit j'ai mal cherché, soit le problème est tellement simple que personne n'ose demander ?)
    J'IMPLORE l'aide des plus grands esprits de cette planète pour me guider à travers cet obscur labyrinthe qu'est Swing.
    Merci

  2. #2
    Membre Expert
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Avril 2004
    Messages
    1 184
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Ingénieur développement logiciels

    Informations forums :
    Inscription : Avril 2004
    Messages : 1 184
    Par défaut
    Pour moi, si un clic sur un bouton effectue n fois la même action, c'est qu'il y a n fois le même listener d'enregistré sur le bouton. Sans voir ton code il va être difficile de t'aider.

  3. #3
    Membre confirmé
    Homme Profil pro
    Développeur Java
    Inscrit en
    Mai 2011
    Messages
    74
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Calvados (Basse Normandie)

    Informations professionnelles :
    Activité : Développeur Java
    Secteur : Bâtiment

    Informations forums :
    Inscription : Mai 2011
    Messages : 74
    Par défaut Puisque vous insistez .....
    Mon panneau "Recherche", je rentre un numéro d'adhérent dans le texAdh

    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
     
    package Biblio;
     
    import java.awt.*;
    import java.awt.event.*;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    import java.sql.Statement;
    import java.text.ParseException;
    import java.util.Vector;
     
    import javax.swing.*;
     
     
     
    @SuppressWarnings("serial")
    public class PanAdherent extends JPanel
    {
     
    	JLabel labSearch  = new JLabel("Recherche par :");
    	JLabel labAut = new JLabel("AUTEUR :");
    	JLabel labTitre = new JLabel("TITRE :");
    	JLabel labTheme = new JLabel("THEME :");
    	JLabel labEditeur = new JLabel("EDITEUR :");
    	JLabel labIsbn = new JLabel("ISBN : ");
    	static JLabel labAdh = new JLabel("ADHERENT :");
    	static JTextField texAut = new JTextField();
    	static JTextField texTitre = new JTextField();
    	static JComboBox<String> texTheme = new JComboBox<String>();
    	static JComboBox<String> texEditeur = new JComboBox<String>();
    	static JTextField texIsbn = new JTextField();
    	static JTextField texAdh = new JTextField();
    	JButton btnAut = new JButton("Vider ce champ");
    	JButton btnTitre = new JButton("Vider ce champ");
    	JButton btnTheme = new JButton("Vider ce champ");
    	JButton btnEditeur = new JButton("Vider ce champ");
    	JButton btnIsbn = new JButton("Vider ce champ");
    	static JButton btnAdh = new JButton("Vider ce champ");
    	JButton btnClearAll = new JButton("Vider tout les champs");
    	JButton btnSearch = new JButton("Lancer la recherche");
    	Vector<String> v = new Vector<String>();
    	Vector<String> vEditeur = new Vector<String>();
    	JPanel zoneClient = new JPanel();
    	private PanSearchAdh adh;
     
    	public PanAdherent() throws ClassNotFoundException, SQLException, ParseException
    	{
    		System.out.println("PanAdherant()");
    		initControl();		
    	}
     
    	public void initControl() throws ClassNotFoundException, SQLException, ParseException
    	{
    		System.out.println("panAdherant // initControl()");
    		setLayout(new BorderLayout());
    		adh = new PanSearchAdh();
    		zoneClient.setLayout(null);
    		labSearch.setFont(new Font("VERDANA",Font.ITALIC+Font.BOLD,35));
    		labSearch.setBounds(10,10,400,40);
    		zoneClient.add(labSearch);
    		setFontLabSea(labAut);
    		labAut.setBounds(20, 90, 100, 20);
    		zoneClient.add(labAut);
    		setFontLabSea(labTitre);
    		labTitre.setBounds(20, 150, 100, 20);
    		zoneClient.add(labTitre);
    		setFontLabSea(labTheme);
    		labTheme.setBounds(20, 210, 100, 20);
    		zoneClient.add(labTheme);
    		setFontLabSea(labEditeur);
    		labEditeur.setBounds(20, 270, 150, 20);
    		zoneClient.add(labEditeur);
    		setFontLabSea(labIsbn);
    		labIsbn.setBounds(20, 330, 100, 20);
    		zoneClient.add(labIsbn);
    		texAut.setBounds(200,90,250,20);
    		zoneClient.add(texAut);
    		texTitre.setBounds(200,150,250,20);
    		zoneClient.add(texTitre);
    		texTheme.setBounds(200,210,250,20);
    		texTheme.setEditable(true);
    		zoneClient.add(texTheme);
    		texEditeur.setBounds(200,270,250,20);
    		texEditeur.setEditable(true);
    		zoneClient.add(texEditeur);
    		texIsbn.setBounds(200,330,250,20);
    		zoneClient.add(texIsbn);
    		btnAut.setBounds(550,90,200,20);
    		zoneClient.add(btnAut);
    		btnTitre.setBounds(550,150,200,20);
    		zoneClient.add(btnTitre);
    		btnTheme.setBounds(550,210,200,20);
    		zoneClient.add(btnTheme);
    		btnEditeur.setBounds(550,270,200,20);
    		zoneClient.add(btnEditeur);
    		btnIsbn.setBounds(550,330,200,20);
    		zoneClient.add(btnIsbn);
     
    		labAdh.setBounds(20,390,150,20);
    		setFontLabSea(labAdh);
    		texAdh.setBounds(200,390,250,20);
    		btnAdh.setBounds(550,390,200,20);
    		zoneClient.add(labAdh);
    		zoneClient.add(texAdh);
    		zoneClient.add(btnAdh);
    		btnClearAll.setBounds(130,490,250,30);
    		zoneClient.add(btnClearAll);
    		btnSearch.setBounds(400,490,300,50);
    		btnSearch.setFont(new Font("ArialBlack",Font.ITALIC,25));
    		btnSearch.addActionListener(new AppActionListener());
    		btnAut.addActionListener(new AppActionListener());
    		btnTitre.addActionListener(new AppActionListener());
    		btnTheme.addActionListener(new AppActionListener());
    		btnEditeur.addActionListener(new AppActionListener());
    		btnIsbn.addActionListener(new AppActionListener());
    		btnAdh.addActionListener(new AppActionListener());
    		btnClearAll.addActionListener(new AppActionListener());
    		zoneClient.add(btnSearch);
     
    		v = getTheme();
    		texTheme.addItem("");
    		for(int i =0 ; i<v.size() ; i++)
    			texTheme.addItem(v.elementAt(i));
    		vEditeur = getEditeur();
    		texEditeur.addItem("");
    		for(int i =0 ; i<vEditeur.size() ; i++)
    			texEditeur.addItem(vEditeur.elementAt(i));
     
    		add(zoneClient, BorderLayout.CENTER);
    	}
     
    	class AppActionListener implements ActionListener
    	{
    		public void actionPerformed(ActionEvent e)
    		{
    			if (e.getSource() == btnSearch)
    				try {
    					go();
    					System.out.println("listener btnSearch");
    					} 
    				catch (ParseException e1) {e1.printStackTrace();}
    			if (e.getSource() == btnAut) texAut.setText("");
    			if (e.getSource() == btnTitre) texTitre.setText("");
    			if (e.getSource() == btnTheme) texTheme.setSelectedIndex(0);
    			if (e.getSource() == btnEditeur) texEditeur.setSelectedIndex(0);
    			if (e.getSource() == btnIsbn) texIsbn.setText("");
    			if (e.getSource() == btnAdh) texAdh.setText("");
    			if (e.getSource() == btnClearAll) clearAll();
    		}
    	}
     
    	public void go() throws ParseException
    	{
    		String strAdh = PanAdherent.texAdh.getText();
    		int lngAdh = strAdh.length();
    		if (lngAdh > 0 ) {
    			System.out.println("PanAdherent go()");SearchAdh();}
    		else 
    		{
    			ResultSearch result = null;
    			try {result = new ResultSearch();}
    			catch (ClassNotFoundException e1) {e1.printStackTrace();}
    			catch (SQLException e1) {e1.printStackTrace();	}
    			removeAll();
    			add(result,BorderLayout.CENTER);
    			revalidate();		
    			clearAll();
    		}
    	}
     
    	public void SearchAdh() throws ParseException
    	{
    		System.out.println("PanAdherent Search Adh()");
    		try {PanSearchAdh.vaChercher(texAdh.getText());}
    		catch (ClassNotFoundException e)
    		{e.printStackTrace();}
    		catch (SQLException e) 
    		{e.printStackTrace();}
    		removeAll();
    		add(adh,BorderLayout.CENTER);
    		revalidate();
    		repaint();
    		adh.revalidate();	
    		adh.repaint();
    	}
     
    	public static Vector<String> getTheme() throws SQLException, ClassNotFoundException
    	{
    		Vector<String> tmp = new Vector<String>();
    		Statement st = ConnectionManager.getConnection().createStatement();
    		ResultSet rs = st.executeQuery("select distinct * from theme order by intitule");
    		while(rs.next())
    		{
    			tmp.add(rs.getString("intitule"));
    		}
    		rs.close();
    		return tmp;
     
    	}
     
    	public static Vector<String> getEditeur() throws SQLException, ClassNotFoundException
    	{
    		Vector<String> tmp = new Vector<String>();
    		Statement st = ConnectionManager.getConnection().createStatement();
    		ResultSet rs = st.executeQuery("select distinct editeur from livre order by editeur");
    		while(rs.next())
    		{
    			tmp.add(rs.getString("editeur"));
    		}
    		rs.close();
    		return tmp;
     
    	}
    	public static void setFontLabSea(JLabel lab)
    	{
    		lab.setFont(new Font("VERDANA",Font.ITALIC,15));
    	}
     
    	public static String nettoyeur (String str)
    	{
    		str.toUpperCase();
    		str.replaceAll("[\\W]|_","");
    		str.replace(" ","");
    		return str;
    	}
     
    	public static void clearAll()
    	{
    		texAut.setText("");
    		texTitre.setText("");
    		texTheme.setSelectedIndex(0);
    		texEditeur.setSelectedIndex(0);
    		texIsbn.setText("");
    	}
     
    }
    puis je clique sur le bouton ok et là ça m'affiche le panneau suivant, avec les informations de l'adhérent dans les bons champs.

    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
     
    package Biblio;
     
    import java.awt.*;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.sql.SQLException;
    import java.text.DateFormat;
    import java.text.ParseException;
    import java.text.SimpleDateFormat;
    import java.util.Calendar;
    import java.util.Date;
    import java.util.GregorianCalendar;
    import java.util.Vector;
     
    import javax.swing.*;
     
    @SuppressWarnings("serial")
    public class PanSearchAdh extends JPanel
     
    {
    	static public  JLabel lblNom = new JLabel("Nom :");
    	static public  JLabel lblPren = new JLabel("Prénom :");
    	static public  JLabel lblAdr = new JLabel("Adresse :");
    	static public  JLabel lblCP = new JLabel("Code Postal :");
    	static public  JLabel lblVille = new JLabel("Ville :");
    	static public  JLabel lblDDN = new JLabel("Date de Naissance :");
    	static public JTextField txtNom = new JTextField();
    	static public JTextField txtPren = new JTextField();
    	static public JTextField txtAdr = new JTextField();
    	static public JTextField txtCP = new JTextField();
    	static public JTextField txtVille = new JTextField();
    	static public JTextField txtDDN = new JTextField();
    	private JLabel lblId = new JLabel("Id :");
    	private JLabel lblDDI = new JLabel("Date d'inscription :");
    	private JLabel lblDFC = new JLabel("Date de Fin de Cotisation :");
    	static JLabel txtId = new JLabel();
    	private static JLabel txtDDI = new JLabel();
    	private static JLabel txtDFC = new JLabel();
    	private static JLabel lblEmp1 = new JLabel("Emprunt en cours");
    	private static JLabel lblEmp2 = new JLabel("Emprunt en cours");
    	private static JLabel lblEmp3 = new JLabel("Emprunt en cours");
    	private static JLabel txtEmp1 = new JLabel();
    	private static JLabel txtEmp2 = new JLabel();
    	private static JLabel txtEmp3 = new JLabel();
    	private static JButton btnEmp1 = new JButton("Voir cet emprunt");
    	private static JButton btnEmp2 = new JButton("Voir cet emprunt");
    	private static JButton btnEmp3 = new JButton("Voir cet emprunt");
    	private JButton btnMod = new JButton("Modifier cet adhérent");
    	private JButton btnModOk = new JButton("Confirmer modifications");
    	private JButton btnSup = new JButton("Supprimer cet adhérent");
    	private static JLabel lblWarning = new JLabel("ATTENTION !!!!!!");
    	private static JLabel lblPerte = new JLabel("Amende en cours");
    	private static JLabel lblCotis = new JLabel("Cotisation expirée");
    	private static JButton btnPerte = new JButton("Payer cette amende");
    	private JLabel lblVide = new JLabel();
    	private static JButton btnCotis = new JButton("MAJ Cotisation");
    	private JPanel SESO = new JPanel(new GridLayout(3,1,5,5));
    	private JPanel SESE = new JPanel(new GridLayout(3,1,5,5));
    	private JPanel SES = new JPanel(new GridLayout(1,2,5,5));
    	private JPanel SEC = new JPanel(new FlowLayout(FlowLayout.CENTER));
    	private JPanel SENO = new JPanel(new BorderLayout(5,5));
    	private JPanel SENE = new JPanel(new BorderLayout(5,5));
    	private JPanel SEN = new JPanel(new GridLayout(1,2,5,5));
    	private JPanel SE = new JPanel(new GridLayout(3,1,5,5));
    	private static JPanel SO = new JPanel(new FlowLayout(FlowLayout.CENTER));
    	private JPanel NESS = new JPanel(new FlowLayout(FlowLayout.CENTER));
    	private JPanel NESC = new JPanel(new FlowLayout(FlowLayout.CENTER));
    	private JPanel NESN = new JPanel(new FlowLayout(FlowLayout.CENTER));
    	private JPanel NES = new JPanel(new GridLayout(3,1,5,5));
    	private JPanel NENO = new JPanel();
    	private JPanel NENE = new JPanel();
    	private JPanel NEN = new JPanel();
    	private JPanel NE = new JPanel(new GridLayout(2,1,5,5));
    	static public  JPanel NOW = new JPanel(new GridLayout(6,1,5,5));
    	static public  JPanel NOC = new JPanel(new GridLayout(6,1,5,5));
    	static public  JPanel NO = new JPanel(new BorderLayout(5,5));
    	private JPanel panPrincipal = new JPanel(new GridLayout(2,2,5,5));
    	private static JScrollPane histo = null;
    	private static JTable tHisto;
    	private static Date dateJour = new Date();
    	private static DateFormat dateFormat = new SimpleDateFormat("dd/MM/YYYY");
    	private static Vector<Emprunt> vEmp = new Vector<Emprunt>();
    	private static Vector<Amende> vAmende = new Vector<Amende>();
    	private static Vector<String> vIdAmende = new Vector<String>();
    	private static JComboBox<String> texAmende = new JComboBox<String>();
    	private static Adherent toto;
    	GregorianCalendar calendar = new java.util.GregorianCalendar();
    	PaieCotis pc;
    	PanRendre pr;
     
    	public PanSearchAdh() throws ParseException
    	{
    		revalidate();
    		initControl();	
    	}
     
    	public void initControl()
    	{
    		setLayout(new BorderLayout(5,5));
    																			//Panneau Sud Est
    		SESO.add(lblPerte);	
    		SESO.add(texAmende);
    		SESO.add(lblCotis);		
    		SESE.add(btnPerte);
    		SESE.add(lblVide);
    		SESE.add(btnCotis);
     
    		SEC.add(lblWarning);
    		lblPerte.setVisible(false);
    		lblCotis.setVisible(false);
    		btnPerte.setVisible(false);
    		btnCotis.setVisible(false);
    		lblWarning.setVisible(false);
    		texAmende.setVisible(false);
    		lblWarning.setFont(new Font("Arial Black",Font.BOLD,25));
    		lblWarning.setForeground(Color.RED);
    		btnMod.addActionListener(new AppActionListener());
    		btnModOk.addActionListener(new AppActionListener());
    		btnSup.addActionListener(new AppActionListener());
    		btnCotis.addActionListener(new AppActionListener());
    		btnPerte.addActionListener(new AppActionListener());
    		SENO.add(btnMod,BorderLayout.CENTER);
    		SENE.add(btnSup,BorderLayout.CENTER);
    		SEN.add(SENO);
    		SEN.add(SENE);
    		SES.add(SESO);
    		SES.add(SESE);
    		SE.add(SEN);
    		SE.add(SEC);
    		SE.add(SES);
     
    		vEmp.removeAllElements();
    		SO.removeAll();
    																			//Panneau Nord Est
    		NESS.add(lblEmp3);
    		NESS.add(txtEmp3);
    		NESS.add(btnEmp3);
    		NESC.add(lblEmp2);
    		NESC.add(txtEmp2);
    		NESC.add(btnEmp2);
    		NESN.add(lblEmp1);
    		NESN.add(txtEmp1);
    		NESN.add(btnEmp1);
    		btnEmp1.addActionListener(new AppActionListener());
    		btnEmp2.addActionListener(new AppActionListener());
    		btnEmp3.addActionListener(new AppActionListener());
    		btnEmp1.setVisible(false);
    		txtEmp1.setVisible(false);
    		lblEmp1.setVisible(false);
    		btnEmp2.setVisible(false);
    		txtEmp2.setVisible(false);
    		lblEmp2.setVisible(false);
    		btnEmp3.setVisible(false);
    		txtEmp3.setVisible(false);
    		lblEmp3.setVisible(false);
    		NES.add(NESN);
    		NES.add(NESC);
    		NES.add(NESS);
    		NENO.setLayout(new BoxLayout(NENO, BoxLayout.Y_AXIS));
    		lblId.setFont(new Font("Verdana",Font.ITALIC,15));
    		lblDDI.setFont(new Font("Verdana",Font.ITALIC,15));
    		lblDFC.setFont(new Font("Verdana",Font.ITALIC,15));
    		txtId.setFont(new Font("Verdana",Font.ITALIC,15));
    		txtDDI.setFont(new Font("Verdana",Font.ITALIC,15));
    		txtDFC.setFont(new Font("Verdana",Font.ITALIC,15));
    		txtDFC.setText("");
    		NENO.add(lblId);
    		NENO.add(lblDDI);
    		NENO.add(lblDFC);
    		NENE.setLayout(new BoxLayout(NENE, BoxLayout.Y_AXIS));
    		NENE.add(txtId);
    		txtId.setText(PanAdherent.texAdh.getText());
     
    		calendar.setTime(dateJour);
     
    		NENE.add(txtDDI);
    		NENE.add(txtDFC);
    		NEN.setLayout(new BoxLayout(NEN, BoxLayout.X_AXIS));
    		NEN.add(NENO);
    		NEN.add(NENE);
    		NE.add(NEN);
    		NE.add(NES);
    																			//Panneau Nord Ouest
    		NOW.add(lblNom);
    		NOW.add(lblPren);
    		NOW.add(lblAdr);
    		NOW.add(lblCP);
    		NOW.add(lblVille);
    		NOW.add(lblDDN);
    		txtNom.setEditable(false);
    		NOC.add(txtNom);
    		txtPren.setEditable(false);
    		NOC.add(txtPren);
    		txtAdr.setEditable(false);
    		NOC.add(txtAdr);
    		txtCP.setEditable(false);
    		NOC.add(txtCP);
    		txtVille.setEditable(false);
    		NOC.add(txtVille);
    		lblNom.setFont(new Font("Verdana",Font.ITALIC,12));
    		lblPren.setFont(new Font("Verdana",Font.ITALIC,12));
    		lblAdr.setFont(new Font("Verdana",Font.ITALIC,12));
    		lblCP.setFont(new Font("Verdana",Font.ITALIC,12));
    		lblVille.setFont(new Font("Verdana",Font.ITALIC,12));
    		lblDDN.setFont(new Font("Verdana",Font.ITALIC,12));
    		txtNom.setFont(new Font("Verdana",Font.BOLD,12));
    		txtPren.setFont(new Font("Verdana",Font.BOLD,12));
    		txtAdr.setFont(new Font("Verdana",Font.BOLD,12));
    		txtCP.setFont(new Font("Verdana",Font.BOLD,12));
    		txtVille.setFont(new Font("Verdana",Font.BOLD,12));
    		txtDDN.setFont(new Font("Verdana",Font.BOLD,12));
     
    		txtDDN.setEditable(false);
    		NOC.add(txtDDN);
    		NO.add(NOW,BorderLayout.WEST);
    		NO.add(NOC,BorderLayout.CENTER);
     
    		panPrincipal.add(NO);
    		panPrincipal.add(NE);
    		panPrincipal.add(SO);
    		panPrincipal.add(SE);
     
    		add(panPrincipal,BorderLayout.CENTER);		
    	}
     
    	public static JPanel panNO()
    	{
    		JPanel panno = new JPanel(new BorderLayout(5,5));
    		NOW.add(lblNom);
    		NOW.add(lblPren);
    		NOW.add(lblAdr);
    		NOW.add(lblCP);
    		NOW.add(lblVille);
    		NOW.add(lblDDN);
    		lblNom.setFont(new Font("Arial Black",Font.ITALIC,25));
    		lblPren.setFont(new Font("Arial Black",Font.ITALIC,25));
    		lblAdr.setFont(new Font("Arial Black",Font.ITALIC,25));
    		lblCP.setFont(new Font("Arial Black",Font.ITALIC,25));
    		lblVille.setFont(new Font("Arial Black",Font.ITALIC,25));
    		lblDDN.setFont(new Font("Arial Black",Font.ITALIC,25));
    		txtNom.setEditable(true);
    		NOC.add(txtNom);
    		txtPren.setEditable(true);
    		NOC.add(txtPren);
    		txtAdr.setEditable(true);
    		NOC.add(txtAdr);
    		txtCP.setEditable(true);
    		NOC.add(txtCP);
    		txtVille.setEditable(true);
    		NOC.add(txtVille);
    		txtDDN.setEditable(true);
    		NOC.add(txtDDN);
    		txtDDN.setText("JJ/MM/AAAA");
    		txtNom.setFont(new Font("Verdana",Font.BOLD,25));
    		txtPren.setFont(new Font("Verdana",Font.BOLD,25));
    		txtAdr.setFont(new Font("Verdana",Font.BOLD,25));
    		txtCP.setFont(new Font("Verdana",Font.BOLD,25));
    		txtVille.setFont(new Font("Verdana",Font.BOLD,25));
    		txtDDN.setFont(new Font("Verdana",Font.BOLD,25));
    		NO.add(NOW,BorderLayout.WEST);
    		NO.add(NOC,BorderLayout.CENTER);
    		panno = NO;
    		return panno;
    	}
     
    //********************************************************LISTENERS******************************************************************
     
    	class AppActionListener implements ActionListener
    	{
    		public void actionPerformed(ActionEvent e)
    		{
    			if (e.getSource() == btnPerte)
    			{
    				EnConstruction.EnConstruction();
    			}
    			if (e.getSource() == PanSearchAdh.btnCotis)
    			{
    				System.out.println("déclencheur paie cotis");
    				pc = new PaieCotis();
    				pc.setVisible(true);
    				pc.setIdAdh(txtId.getText());
    				calendar.add(Calendar.MONTH,12);
    				toto.setAdhDFC(calendar.getTime());
    				txtDFC.setText(dateFormat.format(toto.getAdhDFC()));
    			}
    			if (e.getSource() == btnEmp1)
    			{
    				try 
    				{
    					pr = new PanRendre();
    					removeAll();
    					add(pr, BorderLayout.CENTER);					
    					PanRendre.txtNumEmp.setText(txtEmp1.getText());
    					PanRendre.SearchEmp();
    				} 
    				catch (ClassNotFoundException e1) {	e1.printStackTrace();}
    				catch (SQLException e1) {e1.printStackTrace();}
    			}
    			if (e.getSource() == btnEmp2)
    			{
    				try 
    				{
    					pr = new PanRendre();
    					removeAll();
    					add(pr, BorderLayout.CENTER);
    					PanRendre.txtNumEmp.setText(txtEmp2.getText());
    					PanRendre.SearchEmp();
    				} 
    				catch (ClassNotFoundException e1) {	e1.printStackTrace();}
    				catch (SQLException e1) {e1.printStackTrace();}
    			}
    			if (e.getSource() == btnEmp3)
    			{
    				try 
    				{
    					pr = new PanRendre();
    					removeAll();
    					add(pr, BorderLayout.CENTER);
    					PanRendre.txtNumEmp.setText(txtEmp3.getText());
    					PanRendre.SearchEmp();
    				} 
    				catch (ClassNotFoundException e1) {	e1.printStackTrace();}
    				catch (SQLException e1) {e1.printStackTrace();}
    			}
    			if (e.getSource() == btnMod)
    			{
    				SENO.remove(btnMod);
    				SENO.add(btnModOk,BorderLayout.CENTER);
    				txtNom.setEditable(true);
    				txtPren.setEditable(true);
    				txtAdr.setEditable(true);
    				txtCP.setEditable(true);
    				txtVille.setEditable(true);
    				txtDDN.setEditable(true);
    				validate();
    				repaint();
    			}
    			if (e.getSource() == btnModOk)
    			{
    				SENO.remove(btnModOk);
    				SENO.add(btnMod,BorderLayout.CENTER);
    				txtNom.setEditable(false);
    				txtPren.setEditable(false);
    				txtAdr.setEditable(false);
    				txtCP.setEditable(false);
    				txtVille.setEditable(false);
    				txtDDN.setEditable(false);
    				try 
    				{
    					ValidModif();
    				}
    				catch (ClassNotFoundException e1) {e1.printStackTrace();}
    				catch (SQLException e1) {e1.printStackTrace();}
    				catch (ParseException e1) {e1.printStackTrace();}
    				validate();
    				repaint();
    			}
    			if (e.getSource() == btnSup)
    				try 
    				{
    					GoSup();
    				}
    				catch (NumberFormatException e1) {e1.printStackTrace();}
    				catch (ClassNotFoundException e1) {e1.printStackTrace();} 
    				catch (SQLException e1) {e1.printStackTrace();	}
    		}
    	}
     
    	public void GoSup() throws NumberFormatException, ClassNotFoundException, SQLException
    	{
    		if (vEmp.size() > 0)
    			JOptionPane.showMessageDialog(this,"SUPPRESSION IMPOSSIBLE DES EMPRUNTS SONT EN COURS" ,
    					"Cet adhérent ne va pas s'en tirer comme ça !",JOptionPane.ERROR_MESSAGE, new ImageIcon(("Images/oldbook.png")));
    		if  (vAmende.size() > 0)
    			JOptionPane.showMessageDialog(this,"SUPPRESSION IMPOSSIBLE DES AMENDES SONT EN COURS" ,
    					"Cet adhérent nous doit de l'argent !",JOptionPane.ERROR_MESSAGE, new ImageIcon(("Images/1329582077_money.png")));
    		if (vEmp.size()==0 && vAmende.size() == 0) {
    			int rep = JOptionPane.showConfirmDialog(this,"ETES VOUS SUR DE VOULOIR SUPPRIMER CET ADHERENT ?","Eraser",JOptionPane.YES_NO_OPTION);
    			if (rep == JOptionPane.YES_OPTION){
    				int rep2 = JOptionPane.showConfirmDialog(this,"VOUS ETES VRAIMENT CERTAIN ?","Pas de regret ?",JOptionPane.YES_NO_OPTION);
    				if (rep2 == JOptionPane.YES_OPTION){
    					AdherentManager.deleteAdh(AdherentManager.getAdherent(Integer.parseInt(txtId.getText())));
    					JOptionPane.showMessageDialog(this,"SUPPRESSION EFFECTUÉE" ,
    							"Cet adhérent n'existe plus",JOptionPane.ERROR_MESSAGE, new ImageIcon(("Images/terminator.png")));}
    				if (rep2 == JOptionPane.NO_OPTION)
    					JOptionPane.showMessageDialog(this,"SUPPRESSION CORRECTEMENT ANNULE" ,
    							"Cet adhérent a eu chaud",JOptionPane.ERROR_MESSAGE, new ImageIcon(("Images/Wall.E.png")));
    			}
    		}
    	}
     
    	public static void vaChercher(String num) throws ClassNotFoundException, SQLException, ParseException
    	{
    		System.out.println("PanSearchAdh vaChercher()");
    		int id = Integer.parseInt(num);
    		toto = AdherentManager.getAdherent(id);
    		txtNom.setText(toto.getAdhNom());
    		txtPren.setText(toto.getAdhPren());
     
    		// INSERTION DES INFORMATIONS RELATIVES A L'ADHERENT
    		try {
    			try{txtAdr.setText(toto.getAdhAdr());}
    			catch (Exception e)	{ e.printStackTrace();}
     
    			try{txtCP.setText(String.valueOf(toto.getAdhCP()));}
    			catch (Exception e)	{ e.printStackTrace();}
     
    			try{txtVille.setText(toto.getAdhVille());}
    			catch (Exception e)	{ e.printStackTrace();}
     
    			try{txtDDN.setText(dateFormat.format(toto.getDDN()));}
    			catch (Exception e)	{ e.printStackTrace();}
     
    			try{txtId.setText(toto.getAdhId());}
    			catch (Exception e)	{ e.printStackTrace();}
     
    			try{txtDDI.setText(dateFormat.format(toto.getAdhDDI()));}
    			catch (Exception e)	{ e.printStackTrace();}
     
    			//GESTION DE LA DATE DE FIN DE COTISATION 
    			try{
    			toto = AdherentManager.getDFC(toto);
    			if (toto.getAdhDFC() != null)
    				txtDFC.setText(dateFormat.format(toto.getAdhDFC()));
    			else{
    				JOptionPane.showMessageDialog(new JWindow(), "Cet adhérent n'a pas encore payé sa cotisation","Erreur",JOptionPane.ERROR_MESSAGE,new ImageIcon("Images/1329224175_Warning.png"));
    			lblWarning.setVisible(true);
    			lblCotis.setVisible(true);
    			btnCotis.setVisible(true);}
    			}
    			catch (Exception e)	{ e.printStackTrace();}}
    		catch (Exception e)	{ e.printStackTrace();}
     
    		String sdateJour = dateFormat.format(dateJour);
    		if (toto.getAdhDFC() != null)
    		{	
    			if (PanRendre.stringToDate(txtDFC.getText()).before(PanRendre.stringToDate(sdateJour)))
    			{
    				lblWarning.setVisible(true);
    				lblCotis.setVisible(true);
    				btnCotis.setVisible(true);
    				JOptionPane.showMessageDialog(new JWindow(),"VOTRE COTISATION N'EST PLUS A JOUR !!" ,
    						"La prochaine fois, on vous purge",JOptionPane.ERROR_MESSAGE, new ImageIcon(("Images/bouh.png")));
    			}
    		}
     
    		//GESTION DES EMPRUNTS EN COURS
     
    		vEmp = EmpruntManager.getEmprunt(toto);
    		if (vEmp.size() > 0)
    		{
    			btnEmp1.setVisible(true);
    			txtEmp1.setVisible(true);
    			lblEmp1.setVisible(true);
    			txtEmp1.setText(vEmp.elementAt(0).getIdemprunt());
    			if (vEmp.elementAt(0).getDateRetourMax().before(PanRendre.stringToDate(sdateJour)))
    			{
    				JOptionPane.showMessageDialog(new JWindow(),"L'emprunt "+vEmp.elementAt(0).getIdemprunt()+" a dépassé la date de retour prévue" ,
    						"Vous vous prenez pour qui ?",JOptionPane.ERROR_MESSAGE, new ImageIcon(("Images/bouh.png")));
    			}
    		}
    		if (vEmp.size() > 1)
    		{
    			btnEmp2.setVisible(true);
    			txtEmp2.setVisible(true);
    			lblEmp2.setVisible(true);
    			txtEmp2.setText(vEmp.elementAt(1).getIdemprunt());
    			if (vEmp.elementAt(1).getDateRetourMax().before(PanRendre.stringToDate(sdateJour)))
    			{
    				JOptionPane.showMessageDialog(new JWindow(),"L'emprunt "+vEmp.elementAt(1).getIdemprunt()+" a dépassé la date de retour prévue" ,
    						"Vous vous prenez pour qui ?",JOptionPane.ERROR_MESSAGE, new ImageIcon(("Images/bouh.png")));
    			}
    		}
    		if (vEmp.size() > 2)
    		{
    			btnEmp3.setVisible(true);
    			txtEmp3.setVisible(true);
    			lblEmp3.setVisible(true);
    			txtEmp3.setText(vEmp.elementAt(2).getIdemprunt());
    			if (vEmp.elementAt(2).getDateRetourMax().before(PanRendre.stringToDate(sdateJour)))
    			{
    				JOptionPane.showMessageDialog(new JWindow(),"L'emprunt "+vEmp.elementAt(2).getIdemprunt()+" a dépassé la date de retour prévue" ,
    						"Vous vous prenez pour qui ?",JOptionPane.ERROR_MESSAGE, new ImageIcon(("Images/bouh.png")));
    			}
    		}
     
    		//GESTION DES AMENDES EN COURS
    		try {
    			vAmende = AmendeManager.getAmende(toto);
    			if (vAmende.size()>0)
    			{
    				for (int i=0 ; i<vAmende.size(); i++)
    					vIdAmende.add(i,vAmende.elementAt(i).getIdAmende());
    				for (int i=0 ; i<vIdAmende.size(); i++)
    					texAmende.addItem(vIdAmende.elementAt(i));
    				texAmende.setVisible(true);
    				lblWarning.setVisible(true);
    				lblPerte.setVisible(true);
    				btnPerte.setVisible(true);
    			JOptionPane.showMessageDialog(new JWindow(),"Cet adhérent a des amendes en cours" ,
    					"Par ici la monnaie !!",JOptionPane.ERROR_MESSAGE, new ImageIcon(("Images/bouh.png")));		
    			}
    		}
    		catch(Exception e){e.printStackTrace();}
     
     
    		//GESTION DE L'HISTORIQUE
     
    		tHisto = new JTable(new HistoriqueTable(toto));
    		tHisto.setAutoCreateRowSorter(true);
    		histo = new JScrollPane(tHisto);
    		tHisto.setAutoResizeMode(JTable.AUTO_RESIZE_ALL_COLUMNS );
    		SO.add(histo);
    	}
     
    	public void ValidModif() throws ClassNotFoundException, SQLException, ParseException
    	{
    		int id = Integer.parseInt(txtId.getText());
    		toto = AdherentManager.getAdherent(id);
    		AdherentManager.upadteAdh(toto);
    	}
    }
    Sur ce panneau, j'ai un petit bouton btnCotis , qui ouvre un JDialog, pour payer la cotisation.
    Je peux, d'ici, revenir au premier panneau pour effectuer une nouvelle recherche. Mettons que je le fasse 3 fois, si à la fin je clique sur le bouton btnCotis, je vais avoir 3 JDialog qui s'ouvre.

    Voici le code de mon JDialog, au cas où.

    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
     
    package Biblio;
     
    import java.awt.*;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.sql.CallableStatement;
    import java.sql.Connection;
    import java.sql.SQLException;
     
    import javax.swing.*;
     
    @SuppressWarnings("serial")
    public class PaieCotis extends JDialog 
     
    {
    	private JButton btnOk = new JButton("Ok");
    	private JButton btnCancel = new JButton("Annuler");
    	private JRadioButton optEsp = new JRadioButton("Espèces");
    	private JRadioButton optCB = new JRadioButton("Carte Bleue");
    	private JRadioButton optCq = new JRadioButton("Chèque");
    	private ButtonGroup grpReg = new ButtonGroup();
    	private JPanel panN = new JPanel(new FlowLayout(FlowLayout.CENTER));
    	private JPanel panS = new JPanel(new FlowLayout(FlowLayout.CENTER));
    	private JPanel panC = new JPanel(new FlowLayout(FlowLayout.LEFT));
    	private JTextField txtCom = new JTextField();
    	private JLabel lblCom = new JLabel("Commentaires éventuels :");
    	private  String idAdh = new String();
     
     
     
    	public PaieCotis()
    	{
    		setDefaultCloseOperation(DISPOSE_ON_CLOSE);
    		setResizable(false);
    		setSize(300,190);
    		setTitle("Réglement Cotisation");
    		setLocationRelativeTo(null);
    		initControl();
    	}
     
    	public void initControl()
    	{
    		setLayout(new GridLayout(3,1,5,5));
    		System.out.println("PaieCotis");
    		grpReg.add(optEsp);
    		grpReg.add(optCq);
    		grpReg.add(optCB);
    		panN.setBorder(BorderFactory.createTitledBorder("Mode de Réglement"));
    		panN.add(optEsp);
    		panN.add(optCq);
    		panN.add(optCB);
    		optCB.setSelected(true);
     
    		panC.add(lblCom);
    		txtCom.setColumns(18);
    		panC.add(txtCom);		
     
    		btnCancel.addActionListener(new AppActionListener());
    		btnOk.addActionListener(new AppActionListener());
    		panS.add(btnCancel);
    		panS.add(btnOk);
     
    		add(panN);
    		add(panC);
    		add(panS);		
    	}
     
    	class AppActionListener implements ActionListener
    	{
    		public void actionPerformed(ActionEvent e)
    		{
    			if (e.getSource() == btnCancel) dispose();
    			if (e.getSource() == btnOk)
    				{
    				try {paieCotis();}			
    				catch (ClassNotFoundException e1) {e1.printStackTrace();}
    				catch (SQLException e1) {e1.printStackTrace();}
    				dispose();
    				}
    		}
    	}
     
    	public void paieCotis() throws ClassNotFoundException, SQLException
    	{
    		String adh = idAdh;
    		String mode = null;
    		if (optCB.isSelected()) mode = "CB";
    		if (optCq.isSelected()) mode = "CHEQ";
    		if (optEsp.isSelected()) mode = "ESP";
    		String com;
    		if (txtCom.getText().length() > 0) com = txtCom.getText();
    		else com = null;
    		Connection con = ConnectionManager.getConnection();
    		try
    		{
    		String insertAdh = "begin paie_cotis('"+adh+"',150,'"+mode+"','"+com+"'); end;";									
    		CallableStatement cs = con.prepareCall(insertAdh);
    		cs.execute();
    		JOptionPane.showMessageDialog(this,"Paiement cotisation effectué" ,
    				"money money money",JOptionPane.ERROR_MESSAGE, new ImageIcon(("Images/1329582077_money.png")));
    		}
    		catch(Exception e)
    		{
    			e.printStackTrace();
    		}
    	}
     
    	public final String getIdAdh() {
    		return idAdh;
    	}
     
    	public final void setIdAdh(String idAdh) {
    		this.idAdh = idAdh;
    	}
     
     
    }
    Alors c'est que mon premier programme, ce qui m'embête c'est pas tant que mon programme bugue, mais que je suis persuadé que l'erreur est dans l'appel de mes classes. Même si je rends mon appli dans l'état c'est pas grave, ce qui m'énerve c'est que je veux COMPRENDRE POURQUOI.

    D'avance merci et bon courage pour la lecture.

  4. #4
    Membre Expert
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Avril 2004
    Messages
    1 184
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Ingénieur développement logiciels

    Informations forums :
    Inscription : Avril 2004
    Messages : 1 184
    Par défaut
    Déjà ce qui me "choque" c'est de voir autant de code en "static" et avec en prime un mélange de "static" et de "non static" pour l'interface.

    Essaye d'enlever tout ton code static, normalement tu ne devrais pas en avoir besoin pour faire ton interface swing et ça peut causer des problèmes.

  5. #5
    Membre confirmé
    Homme Profil pro
    Développeur Java
    Inscrit en
    Mai 2011
    Messages
    74
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Calvados (Basse Normandie)

    Informations professionnelles :
    Activité : Développeur Java
    Secteur : Bâtiment

    Informations forums :
    Inscription : Mai 2011
    Messages : 74
    Par défaut
    J'utilisais pas mal de 'static' pour l'accessibilité de mes données membres et des mes méthodes par d'autres classes. (en fait je suivais bêtement les recommandations d'Eclipse).

    Je vais supprimer toutes les références en static pour voir ce que ça donne.

  6. #6
    Membre confirmé
    Homme Profil pro
    Développeur Java
    Inscrit en
    Mai 2011
    Messages
    74
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Calvados (Basse Normandie)

    Informations professionnelles :
    Activité : Développeur Java
    Secteur : Bâtiment

    Informations forums :
    Inscription : Mai 2011
    Messages : 74
    Par défaut


    J'ai supprimé tout les static qui trainaient, du coup j'ai été obligé de redéfinir pas mal de méthodes, ce qui a entrainé après quelques recherches la solution suivante :
    APPELER DES INSTANCES DE CLASSES PLUTÔT QUE LES CLASSES ELLES MÊMES.

    Tout roule niquel maintenant, la vie est belle, les oiseaux chantent, tout ça tout ça.

    merci Mathieu.J !

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

Discussions similaires

  1. Problème de surcharge d'une méthode
    Par sauceaupistou dans le forum C#
    Réponses: 9
    Dernier message: 04/09/2008, 22h47
  2. Réponses: 1
    Dernier message: 25/06/2008, 14h29
  3. Interdire des lancements multiples d'une application
    Par JJJJJ dans le forum Débuter
    Réponses: 7
    Dernier message: 23/02/2008, 18h19
  4. Problème d'exposant sur une méthode mathématique.
    Par ecobarito dans le forum Débuter
    Réponses: 14
    Dernier message: 29/08/2007, 20h16
  5. Problème d'héritage d'une méthode protégée
    Par shenron666 dans le forum C++
    Réponses: 9
    Dernier message: 28/04/2005, 23h17

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