2025-01-29 21:40:42 +01:00
|
|
|
import javax.swing.JFrame;
|
|
|
|
import javax.swing.JTextArea;
|
|
|
|
import javax.swing.JTextField;
|
|
|
|
|
2025-01-28 15:57:06 +01:00
|
|
|
public class Contingences {
|
|
|
|
public static void main(String[] args){
|
|
|
|
JFrame frame = new JFrame("Choix");
|
|
|
|
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
|
|
|
|
2025-01-29 21:40:42 +01:00
|
|
|
|
|
|
|
JTextArea textarea = new JTextArea();
|
|
|
|
JTextField saisie = new JTextField();
|
|
|
|
|
|
|
|
textarea.setBackground(new Color(0, 0, 0));
|
|
|
|
saisie.setBackground(new Color(128, 128, 128));
|
|
|
|
textarea.setForeground(new Color(0, 128, 0));
|
|
|
|
saisie.setForeground(new Color(0, 128, 0).darker());
|
|
|
|
|
|
|
|
textarea.setLineWrap(true);
|
|
|
|
saisie.setLineWrap(true);
|
|
|
|
|
|
|
|
textarea.setVerticalScrollBarPolicy(VERTICAL_SCROLLBAR_AS_NEEDED);
|
|
|
|
|
|
|
|
fenetre.add(saisie, BorderLayout.SOUTH);
|
|
|
|
fenetre.add(textarea, BorderLayout.CENTER);
|
|
|
|
|
|
|
|
|
2025-01-28 15:57:06 +01:00
|
|
|
frame.setSize(1000,500);
|
|
|
|
frame.setLocation(500,250);
|
|
|
|
frame.setVisible(true);
|
|
|
|
}
|
|
|
|
}
|