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
|
@Override
public void paint( Graphics g ){
super.paint( g );
Graphics gc = g.create( 10, 10, image.getWidth( this ), image.getHeight( this ) );
((Graphics2D)gc).setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.15f ));
gc.drawImage(image,0,0,this);
gc.dispose();
//pour qu'ils soit par dessus l'image de fond
txtLogin.paint( txtLogin.getGraphics() );
txtPwd.paint( txtPwd.getGraphics() );
btnOption.paint( btnOption.getGraphics() );
}
@Override
public void repaint( int x, int y, int width, int heigth ){
super.repaint();
Graphics gc = this.getGraphics().create( 10, 10, image.getWidth( this ), image.getHeight( this ) );
((Graphics2D)gc).setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.15f ));
gc.drawImage(image,0,0,this);
gc.dispose();
//pour qu'ils soit par dessus l'image de fond
txtLogin.repaint();
txtPwd.repaint();
btnOption.repaint();
} |
Partager