BUT2/DEV/DEV2.1/TP08_Evenement/Q5_Commande/Q5Main.java~

25 lines
559 B
Java
Raw Normal View History

2023-10-23 13:23:36 +02:00
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class Q5Main{
public static void main(String[] args) {
JFrame fenetre = new JFrame();
fenetre.setSize(500, 300);
fenetre.setLocation(0, 0);
fenetre.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JTextField champsSaisis = new JTextField();
JPanel contenu = new JPanel();
contenu.add(champsSaisis);
FondEvent evenementBouton = new FondEvent(contenu);
champsSaisis.addActionListener(evenementBouton);
fenetre.add(contenu);
fenetre.setVisible(true);
}
}