Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

back ground image repeating  RSS feed

 
Chris Dancy
Ranch Hand
Posts: 136
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hey i have a problem. i set the background image to "something.png" its a repeating pattern which is just for the background. Here is the problem. When i resize my frame, the image only spreads so far, and then theres white space. so is there a quick and easy way to get the image to repeat?

sincerly,
Chris Dancy
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
use the drawImage() with width/height parameters

the swing FAQ has an example

http://faq.javaranch.com/view?BackgroundImageOnJPanel
 
Chris Dancy
Ranch Hand
Posts: 136
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
beautiful. thanks for helping
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!