if (!active) { int w = img.getWidth()+2*START; int h  = img.getHeight()+2*START;
if (!active) { int w = img.getWidth()+2*START, h = img.getHeight()+2*START;
     void setImage(BufferedImage img)     {        if (!active) {            int w = img.getWidth()+2*START;             int h  = img.getHeight()+2*START;            setSizePaintedComponents(new Dimension(w, h));            setWindowSize(img.getWidth()+4*START, img.getHeight()+4*START);        }         canvas.paintImage(img);        active = true;     }