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?

+3


source to share


2 answers


This seems to completely answer my question: fooobar.com/questions/1039833 / ...



+2


source


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 .



+4


source







All Articles