But your trick does not work if you want the JComponent themselve having a background image
On this example, wher je JPanel does not have any background, the Text of the JButton disappears even if the background of the JButton shows the image
import javax.swing.*; import java.io.*; import java.awt.*; import javax.imageio.*; public class ImageBackgroundPanel extends JPanel { private Image background; public ImageBackgroundPanel() { loadImage(); setPreferredSize(new Dimension(background.getWidth(null), background.getHeight(null))); buildGui(); } private void loadImage() { try { Image temp = ImageIO.read(getClass().getResource("back.jpg")); //image is too small, so let's resize it. background = temp.getScaledInstance(temp.getWidth(null) * 2, temp.getHeight(null) * 2, Image.SCALE_SMOOTH); } catch(IOException e) { e.printStackTrace(); } } private void buildGui() { //instantiate ui components. JButton label = new MyButton("This is a button"); add(label); } class MyButton extends JButton { MyButton(String txt) { super(txt); } @Override public void paintComponent(Graphics g) { g.drawImage(background, 0, 0 , getWidth(), getHeight(), null); } } }