Add a background image to the JPanel that repeats

I am using an animated gif and iterate over to fill the whole window.

I read that overriding a method paintComponent

will allow me to create one image; is there a way so that I can draw this image multiple times to fill a space of arbitrary size?


source to share

2 answers

This seems to completely answer my question: / ...



You can try TexturePaint . Here's a basic demo . You can find a more complete example TexturePaint

in this chapter example from Java 2D Graphics .



All Articles