int x = (getWidth()-bi.getWidth())/2; int y = (getHeight()-bi.getHeight())/2; g.drawImage(bi, x, y, null);