No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

titre.java 1.3KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. package Application1;
  2. import java.awt.BorderLayout;
  3. import java.awt.Color;
  4. import java.awt.Dimension;
  5. import java.awt.Font;
  6. import java.awt.Graphics;
  7. import java.awt.Image;
  8. import java.io.File;
  9. import java.io.IOException;
  10. import javax.imageio.ImageIO;
  11. import javax.swing.JLabel;
  12. import javax.swing.JPanel;
  13. import javax.swing.border.EmptyBorder;
  14. public class titre extends JPanel{
  15. public titre() {
  16. JLabel Titre = new JLabel("Charpente 2.0");// ???????????????
  17. Font police = new Font("Arial", Font.BOLD, 24);
  18. Titre.setFont(police);
  19. Titre.setForeground(Color.black);
  20. Titre.setHorizontalAlignment(JLabel.CENTER);
  21. this.add(Titre, BorderLayout.CENTER);
  22. this.setPreferredSize(new Dimension(1200,100));
  23. this.setBorder(new EmptyBorder(50,50,50,50));
  24. }
  25. public void paintComponent(Graphics g) {
  26. try {
  27. Image img1 = ImageIO.read(new File("test.png"));
  28. Image img2 = ImageIO.read(new File("Logo_ISDAT.png"));
  29. Image img3 = ImageIO.read(new File("Nom_cours.png"));
  30. g.drawImage(img1, 20, 10,260,130,0,0,354,142, this);
  31. g.drawImage(img2, 200, 10,370,100,0,0,711,352, this);
  32. g.drawImage(img3, this.getWidth() - 300, 10, this.getWidth() - 12, 100, 0, 0, 260, 63, this);
  33. } catch (IOException e) {
  34. // TODO Auto-generated catch block
  35. e.printStackTrace();
  36. }
  37. }
  38. }