import java.lang.*; public class AccPanel extends JPanel{ private Image menuAcc; public AccPanel(){ super(); this.menuAcc = Toolkit.getDefaultToolkit().getImage("menuAcc.jpg"); } @Override protected void paintComponent(Graphics pinceau){ Graphics secondPinceau = pinceau.create(); if (this.isOpaque()){ secondPinceau.setColor(this.getBackground()); secondPinceau.fillRect(0, 0, this.getWidth(), this.getHeight()); } secondPinceau.drawImage(this.menuAcc,0,0, this); } }