Bonsoir tout le monde.J'ai besoin de votre aide SVP sur un exercice pour mon examen sur les interfaces graphiques:
J'ai construit un frame pour la conversion euro->franc.et j'aimerai ke le resultat s'affiche dans un autre frame.
La premier frame est le suivant:
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
import java.awt.*;
  import java.awt.event.*;
 
import javax.swing.*;
 
  public class Conversion2 extends JFrame implements ActionListener {  
 
 
     private JTextField saisie = new JTextField("0");
     private JButton conversion = new JButton("Conversion");
     private JLabel résultat = new JLabel("0 Franc");
     private JPanel panneau = new JPanel();    
 
     public Conversion2(){
 
    //     this.setLayout(new GridLayout(4,1));
                  this.setLocation(400,100);
                this.setTitle("Conversion");
                 this.setSize(200,100);
                setDefaultCloseOperation(EXIT_ON_CLOSE);
                panneau.setLayout(new BorderLayout());
                saisie.setHorizontalAlignment(JTextField.RIGHT);
                panneau.add(saisie);
                conversion.addActionListener(this);
                panneau.add(conversion, BorderLayout.EAST);
                 add(panneau, BorderLayout.NORTH);
                résultat.setHorizontalAlignment(JLabel.RIGHT);  
                résultat.setBorder(BorderFactory.createEtchedBorder());
                add(résultat, BorderLayout.SOUTH);
                getContentPane().setBackground(Color.WHITE);
                setResizable(true);
                setVisible(true);
 
                this.addWindowListener(new WindowAdapter()
              {
 
                  public void windowClosing(WindowEvent e){System.exit(0);}
              });
 
     }
 
 
            public static void main(String[] args) {
                new Conversion2();  
             }
 
             public void actionPerformed(ActionEvent e) {
 
                 final double TAUX = 6.55957;
                 double €uro = Double.parseDouble(saisie.getText());
                double franc = €uro * TAUX;
 
                if(e.getSource()==conversion)
                {
                     Resultat t=new Resultat();}
              //...  
              }
          }
Comment proceder pour avoir le resultat dans un deuxieme frame ??
Merci d'avance