3

I'm using an animated gif and that it repeats to fill the entire window.

I've read that overriding the paintComponent method will allow me to draw a single image; is there any way that I can draw that image multiple times to fill up an arbitrarily sized space?

Wex
  • 15,539
  • 10
  • 64
  • 107
  • 1
    Similar to [this question](http://stackoverflow.com/questions/2227423/java-swing-background-image) only that your scenario is with JPanel – ring bearer Mar 25 '12 at 22:54
  • It looks like you had cast a duplicate vote at the time you first posted this question, which aged away as the question failed to collect enough votes. For some reason, users are prevented from casting the same vote again even after it's aged away. I've closed the question for you now. – BoltClock Sep 16 '14 at 11:20

1 Answers1

4

You can try TexturePaint. Here is a basic demo. You can find a more complete example of TexturePaint in this sample chapter from Java 2D Graphics book.

tenorsax
  • 21,123
  • 9
  • 60
  • 107