1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
| class TitleSynthese extends JPanel{
public String titre1;
public String titre2;
public String titre3;
public TitleSynthese(String titre1, String titre2, String titre3){
this.titre1 = titre1;
this.titre2 = titre2;
this.titre3 = titre3;
this.setBackground(new Color(196,221,252));
}
protected void paintComponent(Graphics g){
super.paintComponent(g);
g.setColor(Color.black);
g.setFont(new Font("impact", Font.BOLD, 20));
g.drawString(this.titre1,this.getWidth()/5+20,this.getHeight()/3);
g.setColor(Color.gray);
g.drawString(this.titre1,this.getWidth()/5-2+20,this.getHeight()/3-2);
}
} |
Partager