24 lines
713 B
Java
24 lines
713 B
Java
|
import javax.swing.*;
|
||
|
import java.awt.*;
|
||
|
|
||
|
public class 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);
|
||
|
|
||
|
JTextField MyTextField = new JTextField("Hello World!");
|
||
|
MyTextField.setBackground(Color.GRAY);
|
||
|
MyTextField.setForeground(new Color(0, 255, 0));
|
||
|
fenetre.add(MyTextField, BorderLayout.SOUTH);
|
||
|
|
||
|
JTextArea MyTextArea = new JTextArea("Hello World!");
|
||
|
MyTextArea.setBackground(Color.BLACK);
|
||
|
MyTextArea.setForeground(new Color(0, 255, 0));
|
||
|
fenetre.add(MyTextArea, BorderLayout.CENTER);
|
||
|
|
||
|
fenetre.setVisible(true);
|
||
|
}
|
||
|
}
|