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

Java Discussion :

Petit souci avec les Vector


Sujet :

Java

Mode arborescent

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Invité
    Invité(e)
    Par défaut Petit souci avec les Vector
    Bonjour, je suis un niveau intermédiaire en java et j'ai un souci d'index dans un vector .

    l'objet de mon exo est simple faire une réservation pour un billet de transport !
    - on peut choisir le jour de la semaine, une réduction lié à la distance du trajet si on voyage beaucoup, une destination de départ et d'arrivée et le type de transport (bus, train ect.)
    -voici le sujet complet : malefis.u-strasbg.fr/site/Enseignement/POO/TP4/sujet_tp4.pdf

    mon code source complet :

    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
     
    public class Ville{
    	private String nom;
    	private double coordX;
    	private double coordY;
    	public Ville(String nom, double coordX, double coordY) {
    		super();
    		this.nom = nom;
    		this.coordX = coordX;
    		this.coordY = coordY;
    	}
    	public String getNom() {
    		return nom;
    	}
    	public void setNom(String nom) {
    		this.nom = nom;
    	}
    	public double getCoordX() {
    		return coordX;
    	}
    	public void setCoordX(double coordX) {this.coordX = coordX;}
    	public double getCoordY() {return coordY;}
    	public void setCoordY(double coordY) {this.coordY = coordY;}
    	public double getDistance(Ville ville1,Ville ville2){
    		double coordVille1X=ville1.getCoordX();
    		double coordVille1Y=ville1.getCoordY();
    		double coordVille2X=ville2.getCoordX();
    		double coordVille2Y=ville2.getCoordY();
    		double distance =
    				Math.sqrt((coordVille2X-coordVille1X)*(coordVille2X-coordVille1X)+
    					 (coordVille2Y-coordVille1Y)*(coordVille2Y-coordVille1Y));
    		return distance;
    	}
     
    }
    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
     
     
    import java.awt.*;
    import java.awt.event.*;
     
    import javax.swing.*;
    import java.util.Vector;
    import metier.*;
    public class MainWindowVersionUn extends JFrame implements ActionListener, ItemListener {
    	int width=1400;int height=480;
    	String presentationTexteDepart="";
    	String strTempDepart="";
    	String presentationTexteArrivee="";
    	String strTempArrivee="";
    	String presentationTexteTypeVoyageurs="";
    	String strTempTypeVoyageurs="";
    	String presentationTexteTypeTransport="";
    	String strTempTypeTransport="";
    	String presentationTexteJoursSemaine="";
    	String strTempJoursSemaine="";
    	String presentationBilletAllerSimple="";
    	String presentationBilletAllerRetour="";
    	String presentationBilletCarteJeune="";
    	String presentationBilletCarteGrandVoyageurs="";
    	String presentationBilletReducPro="";
    	String presentationBilletReducLoisirs="";
    	String resultTotale=presentationTexteDepart+strTempDepart+
    			presentationTexteArrivee+strTempArrivee+
    			presentationTexteTypeVoyageurs+strTempTypeVoyageurs+
    	presentationTexteTypeTransport+strTempTypeTransport+
    	presentationTexteJoursSemaine+strTempJoursSemaine+
    	presentationBilletAllerRetour+presentationBilletAllerSimple+
    	presentationBilletCarteJeune+presentationBilletCarteGrandVoyageurs+
    	presentationBilletReducPro+presentationBilletReducLoisirs;
    	GridLayout disposition = new GridLayout(9, 2);
    	//------------------- Liste d'items de la liste
    	private final static String[] TAB_VILLES = 
    	{ "Marseille", "Nice", "Bordeaux", "Brest", "Toulouse", "Toulon", "Strasbourg","Paris"};
    	Vector<Ville> tableauVille=new Vector<Ville>();
    	Ville marseille=new Ville("Marseille",70,20);
    	Ville nice=new Ville("Nice",10,10);
    	Ville bordeaux=new Ville("Bordeaux",40,60);
    	Ville brest=new Ville("Brest",10,110);
    	Ville toulouse=new Ville("Toulouse",30,30);
    	Ville toulon=new Ville("Toulon",10,110);
    	Ville strasbourg=new Ville("Strasbourg",11,14);
    	Ville paris=new Ville("Paris",80,80);
    	private final static String[] TAB_SEMAINE = 
    	{ "Lundi", "Mardi", "Mercredi", "Jeudi", "Vendredi", "Samedi", "Dimanche"};
    	private final static String[] TAB_TYPES_TRANSPORT = 
    	{ "MiniBus", "BusNormal", "TGV", "TER", "TIC"};
    	private JPanel panelStatusBar=new JPanel();
    	private JPanel panelReservations=new JPanel();
    	private JPanel panelAdministrateur=new JPanel();
    	private JLabel lbTauxTVE=new JLabel("TVE : ");
    	private JTextField textFieldTVE=new JTextField(20);
    	private JLabel lbChoixVilleDepart=new JLabel("Choisir votre ville de depart");
    	private JComboBox comboBoxVilleDepart=new JComboBox(tableauVille);
    	private JLabel lbChoixVilleArrivee=new JLabel("Choisir votre ville d'arrivée");
    	private JComboBox comboBoxVilleArrivee=new JComboBox(tableauVille);
    	private JLabel lbChoixTypeTransport=new JLabel("Quel type moyen de transport allez-vous prendre ?");
    	private JComboBox comboBoxTypeTransport=new JComboBox(TAB_TYPES_TRANSPORT);
    	private JLabel lbChoixJoursSemaine=new JLabel("Quels est le jours de la semaine ?");
    	private JComboBox comboBoxJoursSemaine=new JComboBox(TAB_SEMAINE);
     
    	private JPanel panelAllerRetour=new JPanel();
    	private ButtonGroup buttonGroupAllerRetour=new ButtonGroup();
    	private JLabel lbChoixAllerRetour=new JLabel("est-ce que ce un aller-retour ou un aller-simple");
    	private JRadioButton radioButtonAllerRetour=new JRadioButton("Aller Retour");
    	private JRadioButton radioButtonAllerSimple=new JRadioButton("Aller Simple");
     
    	private JPanel panelTypeVoyageurs=new JPanel();
    	private ButtonGroup buttonGroupTypeVoyageurs=new ButtonGroup();
    	private JLabel lbChoixTypeVoyageurs=new JLabel("Quel type de voyageurs etes vous ?");
    	private JRadioButton radioButtonCarteJeune=new JRadioButton("Carte Jeune");
    	private JRadioButton radioButtonCarteGrandVoyageurs=new JRadioButton("Carte Grand Voyageurs");
     
    	private JPanel panelCarteReduc=new JPanel();
    	private ButtonGroup buttonGroupCarteReduc=new ButtonGroup();
    	private JLabel lbChoixCarteReduc=new JLabel("Choisir votre carte de reduction");
    	private JRadioButton radioButtonReducLoisirs=new JRadioButton("Loisirs");
    	private JRadioButton radioButtonReducPro=new JRadioButton("Professionnels");
     
    	private JLabel lbPrix=new JLabel("Prix");	
    	private JTextField resultPrix=new JTextField(20);
    	private JTextArea textAreaResult=new JTextArea(300, 55);
    	JScrollPane spAreaResult = new JScrollPane(textAreaResult);
     
    	private JButton bouton = new JButton("Go");
    	private JButton bouton2 = new JButton("Stop");
     
    	public MainWindowVersionUn(String title){
    		super(title);
    		this.setSize(width,height);
    		this.setVisible(true);
    		this.setDefaultCloseOperation(EXIT_ON_CLOSE);
    	    bouton.addActionListener(new BoutonListener());     
    	    bouton2.addActionListener(new Bouton2Listener());
    		gestionDisposition();
    		gestionActionListener();
    		gestionAffichage();
    		ajoutValeurComboBox();
    	}
    	public void ajoutValeurComboBox(){
     
    		comboBoxVilleDepart.addItem(marseille.getNom());
    		comboBoxVilleDepart.addItem(nice.getNom());
    		comboBoxVilleDepart.addItem(brest.getNom());
    		comboBoxVilleDepart.addItem(toulouse.getNom());
    		comboBoxVilleDepart.addItem(bordeaux.getNom());
    		comboBoxVilleDepart.addItem(toulon.getNom());
    		comboBoxVilleDepart.addItem(strasbourg.getNom());
    		comboBoxVilleDepart.addItem(paris.getNom());
    		comboBoxVilleArrivee.addItem(marseille.getNom());
    		comboBoxVilleArrivee.addItem(nice.getNom());
    		comboBoxVilleArrivee.addItem(brest.getNom());
    		comboBoxVilleArrivee.addItem(toulouse.getNom());
    		comboBoxVilleArrivee.addItem(bordeaux.getNom());
    		comboBoxVilleArrivee.addItem(toulon.getNom());
    		comboBoxVilleArrivee.addItem(strasbourg.getNom());
    		comboBoxVilleArrivee.addItem(paris.getNom());
    	}
    	public void gestionDisposition(){
    		panelReservations.setLayout(disposition);
    		panelReservations.add(lbChoixVilleDepart);panelReservations.add(comboBoxVilleDepart);
    		panelReservations.add(lbChoixVilleArrivee);panelReservations.add(comboBoxVilleArrivee);
     
    		panelReservations.add(lbChoixTypeTransport);panelReservations.add(comboBoxTypeTransport);
     
    		panelReservations.add(lbChoixJoursSemaine);panelReservations.add(comboBoxJoursSemaine);
     
    		panelReservations.add(lbChoixCarteReduc);panelReservations.add(panelCarteReduc);
    		buttonGroupCarteReduc.add(radioButtonReducLoisirs);buttonGroupCarteReduc.add(radioButtonReducPro);
    		panelCarteReduc.add(radioButtonReducLoisirs);panelCarteReduc.add(radioButtonReducPro);
     
    		panelReservations.add(lbChoixTypeVoyageurs);panelReservations.add(panelTypeVoyageurs);
    		panelTypeVoyageurs.add(radioButtonCarteJeune);panelTypeVoyageurs.add(radioButtonCarteGrandVoyageurs);
    		buttonGroupTypeVoyageurs.add(radioButtonCarteJeune);buttonGroupTypeVoyageurs.add(radioButtonCarteGrandVoyageurs);
    		panelReservations.add(lbChoixAllerRetour);panelReservations.add(panelAllerRetour);
    		panelAllerRetour.add(radioButtonAllerRetour);panelAllerRetour.add(radioButtonAllerSimple);
    		panelReservations.add(lbPrix);panelReservations.add(resultPrix);
    		panelAdministrateur.add(lbTauxTVE);panelAdministrateur.add(textFieldTVE);
    		panelReservations.add(bouton);panelReservations.add(bouton2);
    		add(panelAdministrateur,BorderLayout.WEST);
    		add(panelReservations,BorderLayout.EAST);
    		add(spAreaResult,BorderLayout.CENTER);
    		add(panelStatusBar, BorderLayout.SOUTH );
     
    	}
     
    	public void gestionActionListener(){
    	    comboBoxVilleDepart.addActionListener(new ActionListener(){
    	    	@Override
    	    	public void actionPerformed(ActionEvent e) {
    	    		presentationTexteDepart="Départ de :  ";
    	    		textAreaResult.append(presentationTexteDepart);
    	    		strTempDepart=comboBoxVilleDepart.getSelectedItem().toString();
    	    		textAreaResult.append(strTempDepart+'\n');
    	    		}});
    	    comboBoxVilleArrivee.addActionListener(new ActionListener(){
    	    	@Override
    	    	public void actionPerformed(ActionEvent e) {
    	    		presentationTexteArrivee="Arrivée de :  ";
    	    		textAreaResult.append(presentationTexteArrivee);
    	    		strTempArrivee=comboBoxVilleArrivee.getSelectedItem().toString();
    	    		textAreaResult.append(strTempArrivee+'\n');
    	    		}});
     
    	    comboBoxTypeTransport.addActionListener(new ActionListener(){
    	    	@Override
    	    	public void actionPerformed(ActionEvent e) {
    	    		presentationTexteTypeTransport="Type de Transport :  ";
    	    		textAreaResult.append(presentationTexteTypeTransport);
    	    		strTempTypeTransport=comboBoxTypeTransport.getSelectedItem().toString();
    	    		textAreaResult.append(strTempTypeTransport+'\n');
    	    		}});
    	    comboBoxJoursSemaine.addActionListener(new ActionListener(){
    	    	@Override
    	    	public void actionPerformed(ActionEvent e) {
    	    		presentationTexteJoursSemaine="Jours de la semaine :  ";
    	    		textAreaResult.append(presentationTexteJoursSemaine);
    	    		strTempJoursSemaine=comboBoxJoursSemaine.getSelectedItem().toString();
    	    		textAreaResult.append(strTempJoursSemaine+'\n');
    	    		}});
    	    radioButtonAllerRetour.addActionListener(new ActionListener(){
    	    	@Override
    	    	public void actionPerformed(ActionEvent e){
    	    		presentationBilletAllerRetour="Aller-Retour : ";
    	    		presentationBilletAllerSimple="Aller-Simple : ";
    	    		if(radioButtonAllerRetour.isSelected()){
    	    			textAreaResult.append(presentationBilletAllerRetour);
    	    			textAreaResult.append("Oui"+'\n');}
    	    		else {
    	    			textAreaResult.append(presentationBilletAllerSimple);
    	    			textAreaResult.append("Non"+'\n');}
    	    	}
    	    });
    	    radioButtonAllerSimple.addActionListener(new ActionListener(){
    	    	@Override
    	    	public void actionPerformed(ActionEvent e){
    	    		presentationBilletAllerRetour="Aller-Retour : ";
    	    		presentationBilletAllerSimple="Aller-Simple : ";
    	    		if(radioButtonAllerSimple.isSelected()){
    	    			textAreaResult.append(presentationBilletAllerSimple);
    	    			textAreaResult.append("Non"+'\n');}
    	    		else {
    	    			textAreaResult.append(presentationBilletAllerRetour);
    	    			textAreaResult.append("Oui"+'\n');}
    	    	}
    	    });
    	    radioButtonReducLoisirs.addActionListener(new ActionListener(){
    	    	@Override
    	    	public void actionPerformed(ActionEvent e){
    	    		presentationBilletReducPro="Reduction Pro : ";
    	    		presentationBilletReducLoisirs="Reduction Loisirs : ";
    	    		if(radioButtonReducLoisirs.isSelected()){
    	    			textAreaResult.append(presentationBilletReducLoisirs);
    	    			textAreaResult.append("Oui"+'\n');}
    	    		else {
    	    			textAreaResult.append(presentationBilletReducPro);
    	    			textAreaResult.append("Oui"+'\n');}
    	    	}
    	    });
    	    radioButtonReducPro.addActionListener(new ActionListener(){
    	    	@Override
    	    	public void actionPerformed(ActionEvent e){
    	    		presentationBilletReducPro="Reduction Pro : ";
    	    		presentationBilletReducLoisirs="Reduction Loisirs : ";
    	    		if(radioButtonReducPro.isSelected()){
    	    			textAreaResult.append(presentationBilletReducPro);
    	    			textAreaResult.append("Non"+'\n');}
    	    		else {
    	    			textAreaResult.append(presentationBilletReducLoisirs);
    	    			textAreaResult.append("Oui"+'\n');}
    	    	}
    	    });
    	    radioButtonCarteJeune.addActionListener(new ActionListener(){
    	    	@Override
    	    	public void actionPerformed(ActionEvent e){
    	    		presentationBilletCarteJeune="Carte Jeune : ";
    	    		presentationBilletCarteGrandVoyageurs="Carte Grand Voyageurs : ";
    	    		if(radioButtonCarteJeune.isSelected()){
    	    			textAreaResult.append(presentationBilletCarteJeune);
    	    			textAreaResult.append("Oui"+'\n');}
    	    		else {
    	    			textAreaResult.append(presentationBilletCarteGrandVoyageurs);
    	    			textAreaResult.append("Oui"+'\n');}
    	    	}
    	    });
    	    radioButtonCarteGrandVoyageurs.addActionListener(new ActionListener(){
    	    	@Override
    	    	public void actionPerformed(ActionEvent e){
    	    		presentationBilletCarteJeune="Carte Jeune : ";
    	    		presentationBilletCarteGrandVoyageurs="Carte Grand Voyageurs : ";
    	    		if(radioButtonCarteGrandVoyageurs.isSelected()){
    	    			textAreaResult.append(presentationBilletCarteGrandVoyageurs);
    	    			textAreaResult.append("Non"+'\n');}
    	    		else {
    	    			textAreaResult.append(presentationBilletCarteJeune);
    	    			textAreaResult.append("Oui"+'\n');}
    	    	}
    	    });
    	}
    	public void gestionAffichage(){
    		textAreaResult.setText(resultTotale);
    	}
    	public static void main(String[] args) {new MainWindowVersionUn("Systeme de Reservation de transport");}
    	@Override
    	public void actionPerformed(ActionEvent e) {
     
    		}
    	@Override
    	public void itemStateChanged(ItemEvent e) {
     
    	}
    	  public class BoutonListener implements ActionListener{
    		     public void actionPerformed(ActionEvent arg0) {
    		    	 int contentsVilleDepart = comboBoxVilleDepart.getSelectedIndex();
    		    	 int contentsVilleArrivee = comboBoxVilleArrivee.getSelectedIndex();
    		    	 System.out.println(contentsVilleDepart+" "+contentsVilleArrivee);
    		    	 if(contentsVilleDepart !=contentsVilleArrivee) {
    		    		 Trajet trajetUn
    		    		 =new Trajet(
    		    				 tableauVille.get(contentsVilleDepart),
    		    				 tableauVille.get(contentsVilleArrivee));
    		    		 System.out.println("Distance : "+trajetUn.getDistance(marseille,nice));
    		    	        System.out.println("Selected index=" + comboBoxVilleDepart.getSelectedIndex()
    		    	                + " Selected item=" + comboBoxVilleDepart.getSelectedItem());
    		    	        System.out.println("Selected index=" + comboBoxVilleArrivee.getSelectedIndex()
    		    	                + " Selected item=" + comboBoxVilleArrivee.getSelectedItem());
    		    	 }
     
    		      bouton.setEnabled(false);
    		      bouton2.setEnabled(true); 
    		      if(bouton.isSelected())
    		      gestionActionListener();
    		    }
    		  }
     
    	  public class Bouton2Listener implements ActionListener{
    		    public void actionPerformed(ActionEvent e) {
     
    		      bouton.setEnabled(true);
    		      bouton2.setEnabled(false);
    		    }  
    		  }  
     
     
    }
    l'objet de mon souci se situe ici :

    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
     
     
    public void actionPerformed(ActionEvent arg0) {
    		    	 int contentsVilleDepart = comboBoxVilleDepart.getSelectedIndex();
    		    	 int contentsVilleArrivee = comboBoxVilleArrivee.getSelectedIndex();
    		    	 System.out.println(contentsVilleDepart+" "+contentsVilleArrivee);
    		    	 if(contentsVilleDepart !=contentsVilleArrivee) {
    		    		 Trajet trajetUn
    		    		 =new Trajet(
    		    				 tableauVille.get(contentsVilleDepart),
    		    				 tableauVille.get(contentsVilleArrivee));
    		    		 System.out.println("Distance : "+trajetUn.getDistance(marseille,nice));
    		    	        System.out.println("Selected index=" + comboBoxVilleDepart.getSelectedIndex()
    		    	                + " Selected item=" + comboBoxVilleDepart.getSelectedItem());
    		    	        System.out.println("Selected index=" + comboBoxVilleArrivee.getSelectedIndex()
    		    	                + " Selected item=" + comboBoxVilleArrivee.getSelectedItem());
    		    	 }
    voici le code erreur :

    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
     
    0 -1
    Exception in thread "AWT-EventQueue-0" java.lang.ClassCastException: java.lang.String cannot be cast to metier.Ville
    	at IHM.MainWindowVersionUn$BoutonListener.actionPerformed(MainWindowVersionUn.java:284)
    	at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2018)
    	at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2341)
    	at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
    	at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
    	at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252)
    	at java.awt.Component.processMouseEvent(Component.java:6516)
    	at javax.swing.JComponent.processMouseEvent(JComponent.java:3311)
    	at java.awt.Component.processEvent(Component.java:6281)
    	at java.awt.Container.processEvent(Container.java:2229)
    	at java.awt.Component.dispatchEventImpl(Component.java:4872)
    	at java.awt.Container.dispatchEventImpl(Container.java:2287)
    	at java.awt.Component.dispatchEvent(Component.java:4698)
    	at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4832)
    	at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4492)
    	at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4422)
    	at java.awt.Container.dispatchEventImpl(Container.java:2273)
    	at java.awt.Window.dispatchEventImpl(Window.java:2719)
    	at java.awt.Component.dispatchEvent(Component.java:4698)
    	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:735)
    	at java.awt.EventQueue.access$200(EventQueue.java:103)
    	at java.awt.EventQueue$3.run(EventQueue.java:694)
    	at java.awt.EventQueue$3.run(EventQueue.java:692)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
    	at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:87)
    	at java.awt.EventQueue$4.run(EventQueue.java:708)
    	at java.awt.EventQueue$4.run(EventQueue.java:706)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
    	at java.awt.EventQueue.dispatchEvent(EventQueue.java:705)
    	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
    	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
    	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
    	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
    	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
    	at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)
    ma question est simple comment recuperer l'objet selectionné provenant des JComboBox pour renvoyer la distance entre les 2 villes

    merci à tous pour la reponse

    BlackAllSun
    Dernière modification par joel.drigo ; 30/08/2014 à 18h04. Motif: Séparation code en 2 classes disctintes

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

Discussions similaires

  1. Petit soucis avec les doubles
    Par yakamoneye dans le forum Débuter
    Réponses: 30
    Dernier message: 08/06/2008, 11h04
  2. Un petit souci avec les dates
    Par Ben-o dans le forum SQL Procédural
    Réponses: 11
    Dernier message: 27/09/2007, 18h42
  3. Réponses: 10
    Dernier message: 26/10/2006, 12h25
  4. petit soucis avec les listes
    Par Death83 dans le forum Balisage (X)HTML et validation W3C
    Réponses: 2
    Dernier message: 03/09/2005, 10h08

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