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
| import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Font;
import java.io.IOException;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
public class Acceuil2 extends JFrame {
private static final long serialVersionUID = 1L;
ImagePanel container =new ImagePanel(new ImageIcon("img.jpg").getImage());
private JPanel pan1 = new JPanel();
private JPanel pan2 = new JPanel ();
JButton bouton1 = new JButton("menu Utilisateur");
JButton bouton2 = new JButton("menu administrateur");
JButton bouton = new JButton("visite virtuel");
JButton bouton3 = new JButton("Quitter");
String line;
private JLabel label = new JLabel("siteweb");
JPanel surfTotPanel = new JPanel();
JTextArea grandeZone = new JTextArea(3, 2);
public Acceuil2(){
container.setLayout(new BorderLayout());
JScrollPane texteAsc;
Font fonte;
int tailleInitiale = 20;
texteAsc = new JScrollPane(grandeZone);
bouton1.setBounds(700, 70,170, 50);
bouton2.setBounds(700, 170, 170, 50);
bouton.setBounds(700, 270, 170, 50);
grandeZone.setBounds(0, 0, 0, 0);
texteAsc.setBounds(0,0, 0, 0);
this.setTitle("Ma fenetre ");
this.setSize(900, 500);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.setLocationRelativeTo(null);
fonte = new Font("andalus", Font.ROMAN_BASELINE, tailleInitiale);
grandeZone.setFont(fonte);
container.add(label,BorderLayout.NORTH);
container.add(bouton1);
container.add(bouton2);
container.add(bouton);
container.add(texteAsc);
Font police = new Font("Times new Roman", Font.CENTER_BASELINE, 30);
label.setFont(police);
label.setForeground(Color.blue);
label.setHorizontalAlignment(JLabel.CENTER);
this.setContentPane(container);
this.setVisible(true);
}
public static void main(String[] args) throws IOException{
Acceuil2 ac= new Acceuil2 ();
ac.setVisible(true);
}
} |
Partager