12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- package Application1;
-
- import java.awt.BorderLayout;
- import java.awt.Color;
- import java.awt.Dimension;
- import java.awt.Font;
- import java.awt.Graphics;
- import java.awt.Image;
- import java.io.File;
- import java.io.IOException;
-
- import javax.imageio.ImageIO;
- import javax.swing.JLabel;
- import javax.swing.JPanel;
- import javax.swing.border.EmptyBorder;
-
- public class titre extends JPanel{
- public titre() {
-
- JLabel Titre = new JLabel("Charpente 2.0");// ???????????????
- Font police = new Font("Arial", Font.BOLD, 24);
- Titre.setFont(police);
- Titre.setForeground(Color.black);
- this.setBackground(Color.WHITE);
- Titre.setHorizontalAlignment(JLabel.CENTER);
- this.add(Titre, BorderLayout.CENTER);
- this.setPreferredSize(new Dimension(1200,100));
- this.setBorder(new EmptyBorder(50,50,50,50));
-
-
- }
-
- public void paintComponent(Graphics g) {
- try {
- Image img1 = ImageIO.read(new File("test.png"));
- Image img2 = ImageIO.read(new File("Logo_ISDAT.png"));
- Image img3 = ImageIO.read(new File("Nom_cours.png"));
- g.drawImage(img1, 20, 10,260,130,0,0,354,142, this);
- g.drawImage(img2, 200, 10,370,100,0,0,711,352, this);
- g.drawImage(img3, this.getWidth() - 300, 10, this.getWidth() - 12, 100, 0, 0, 260, 63, this);
-
-
-
-
- } catch (IOException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
-
-
-
- }
-
-
- }
|