30 lines
965 B
Java
30 lines
965 B
Java
import javax.swing.*;
|
|
import java.awt.*;
|
|
|
|
public class Saisie{
|
|
|
|
public static void main(String[] args){
|
|
JFrame fenetre = new JFrame(); //Objet representant la fenetre
|
|
fenetre.setSize(500, 300); //taille de la fenetre
|
|
fenetre.setLocation(0, 0); //position de la fenetre dans l'ecran
|
|
fenetre.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
|
|
|
Color vert = new Color(0,255,0);
|
|
Color noir = new Color(0,0,0);
|
|
Color gris = new Color(100,100,100);
|
|
|
|
JTextField champDeTexte = new JTextField("Champ de texte");
|
|
champDeTexte.setHorizontalAlignment(JTextField.CENTER);
|
|
champDeTexte.setBackground(gris);
|
|
champDeTexte.setForeground(vert);
|
|
fenetre.add(champDeTexte, BorderLayout.SOUTH);
|
|
|
|
JTextArea zoneDeTexte = new JTextArea("Zone de texte");
|
|
zoneDeTexte.setBackground(noir);
|
|
zoneDeTexte.setForeground(vert);
|
|
fenetre.add(zoneDeTexte, BorderLayout.CENTER);
|
|
|
|
|
|
fenetre.setVisible(true);
|
|
}
|
|
} |