BUT2/DEV/DEV2.1/TP10_exceptions.java/Q5_Degres/DetectConvertion.java~
2023-10-23 13:23:36 +02:00

21 lines
577 B
Java

import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class DetectConvertion implements ActionListener{
public JTextField champsFarenheit;
public JTextField champsCelsius;
public DetectConvertion(JTextField champsFarenheit, JTextField champsCelsius){
this.champsFarenheit = champsFarenheit;
this.champsCelsius = champsCelsius;
}
@Override
public void actionPerformed(ActionEvent evenement){
String valeur = evenement.getActionCommand();
this.champsCelsius.setText("");
this.champsFarenheit.setText(valeur);
}
}