/**
 * Created by IntelliJ IDEA.
 * User: jwill
 * Released under the GPL
 * No change from original file but to remove semicolons and extend a JXPanel
 * instead of JPanel
 */

import java.awt.Graphics
import java.awt.image.BufferedImage
import javax.imageio.ImageIO
import org.jdesktop.swingx.JXPanel

class WoodenContentPane extends JXPanel {
    private static boolean isInitialized = false;
    private static BufferedImage background = null

    public WoodenContentPane() {
        if (!isInitialized) {
            try {
                background = ImageIO.read(getClass().getResource("/wood.png"))
                isInitialized = true
            } catch (IOException ex) {
                ex.printStackTrace()
            }
        }
    }

    @Override
    protected void paintComponent(Graphics g) {
        if (isInitialized) {
            g.drawImage(background, 0, 0, null)
        }
    }
}
