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 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70
| import javax.swing.*;
import java.awt.*;
public class Fenarij
{
public static void main(String[] args)
{
JFrame fenetre = new JFrame();
JPanel panel = new JPanel();
JLabel welcome = new JLabel("Bienvenue en tunisie Telecom ");
JLabel actel = new JLabel("ACTEL beit elhekma Kairouan");
JLabel gestion = new JLabel("Gestion des publitels ");
fenetre.setContentPane(panel);
fenetre.setTitle("acceuil");
fenetre.getContentPane().setBackground(new Color(255,255,255));
Font font = new Font("Monotype Corsiva",Font.BOLD,20);
welcome.setForeground(new Color(0,51,255));
welcome.setFont(font);
actel.setFont(font);
actel.setForeground(new Color(0,51,255));
Font font1 = new Font("Monotype Corsiva",Font.BOLD,15);
gestion.setFont(font1);
panel.add(welcome);
panel.add(actel);
panel.add(gestion);
JLabel a = new JLabel("ADMINISTRATEUR");
JLabel b = new JLabel("RESPONSABLE ADMINISTRATIF");
a.setFont(font);
b.setFont(font);
a.setForeground(new Color(0,135,204));
b.setForeground(new Color(0,135,204));
Box ABox1 = Box.createHorizontalBox();
ABox1.add(a);
ABox1.add(Box.createHorizontalStrut(30));
ABox1.add(b);
ImageIcon icone = new ImageIcon("taxi-phone.jpg");
JLabel image = new JLabel(icone);
image.setSize(panel.getWidth(),panel.getHeight());
Box ABox2= Box.createVerticalBox();
ABox2.add(Box.createVerticalStrut(100));
ABox2.add(ABox1);
ABox2.add(Box.createVerticalStrut(100));
ABox2.add(image);
panel.add(ABox2);
panel.repaint();
fenetre.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
fenetre.setVisible(true);
fenetre.setSize(570,500);
Dimension dim = Toolkit.getDefaultToolkit().getScreenSize();
fenetre.setLocation(dim.width/2 - fenetre.getWidth()/2, dim.height/2 - fenetre.getHeight()/2);
}
} |
Partager