1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
| Font oldFont=getFont();
Font font=new Font("TimesRoman", Font.ITALIC, 9); setTitle("Client");
//Construction de linterface graphique
clavier=new TextField(50);
console=new TextArea("",10,50,TextArea.SCROLLBARS_BOTH);
console.setEditable(false);
console.setBackground(Color.gray);
this.setLayout(new BorderLayout());
Panel pConsole=new Panel();
Panel pClavier=new Panel();
this.add("North", pConsole);
this.add("Center", pClavier);
pConsole.setLayout(new BorderLayout());
pConsole.add("North", new Label(" Console "));
pConsole.add("Center", console);
pClavier.setLayout(new BorderLayout());
pClavier.add("North", new Label(" Saisie : "));
pClavier.add("Center", clavier);
Panel pBoutons=new Panel();
pBoutons.setLayout(new BorderLayout(5,0));
this.add("South", pBoutons);
Boutons=new Panel();
pBoutons.add("North", Boutons);
Panel copyR=new Panel();
copyR.setFont(font);
copyR.add("North", new Label(" Julien "));
pBoutons.add("South", copyR);
Envoi=new Button("Envoyer");
Stop=new Button("Quitter");
Boutons.add(Envoi);
Boutons.add(Stop);
Envoi.addActionListener(new toSend());
Stop.addActionListener(new toExit());
clavier.addActionListener(new toSend());
this.pack();
this.show(); |
Partager