BUT2/DEV/DEV2.1/TP02_Composants_graphiques/Q3_Saisie.java~

32 lines
838 B
Java
Raw Permalink Normal View History

2023-10-23 13:23:36 +02:00
import javax.swing.*;
import java.awt.*;
public class Q3_Saisie{
public static void main(String[] args) {
JFrame fenetre = new JFrame();
fenetre.setSize(500, 300);
fenetre.setLocation(0, 0);
fenetre.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
Font myFont1 = new Font("Arial", FONT.BOLD, 14);
JTextField champsTexte = new JTextField("");
champsTexte.setBackground(new Color(206,206,206));
champsTexte.setForeground(Color.GREEN);
champsTexte.setFont(myFont1);
fenetre.add(champsTexte, BorderLayout.SOUTH);
JTextArea zoneTexte = new JTextArea("Saisissez votre texte");
zoneTexte.setBackground(new Color(0,0,0));
zoneTexte.setForeground(new Color(30,220,30));
zoneTexte.setFont(myFont1);
fenetre.add(zoneTexte);
fenetre.setVisible(true);
}
}