How to fit Image size to JFrame Size?

You want the drawImage() that scales to the target container. See the article cited here for alternatives. For example,

g.drawImage(img, 0, 0, getWidth(), getHeight(), this);

Leave a Comment