Color oldColor = g.getColor(); if(mainImage == null) return;
if (mainImage == null) return;
    public void drawInto(Graphics g,int width, int height){        Color oldColor = g.getColor();        if(mainImage == null) return;                //Checking behavior of painter        if((behavior & NO_TILING) != 0){            drawNoTiling(g,width,height);            return;        }                if((behavior & TILING_BOTH) != 0){            drawTilingBoth(g,width,height);            return;        }                if((behavior & TILING_VERTICAL) != 0){            drawTilingVertical(g,width,height);            return;        }                if((behavior & TILING_HORIZONTAL) != 0){            drawTilingHorizontal(g,width,height);            return;        }            }