• Post Reply Bookmark Topic Watch Topic
  • New Topic

Problem with ImageDraw

 
Ignas Sliuzas
Greenhorn
Posts: 13
Firefox Browser Java Notepad
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello everyone, here's my problem: whenever I scroll with scrollbars in my program parts in the window get painted over with random bits of my image files.

What I believe is causing this is: in method ImageDraw(img, int, int, observer) the observer variable should be the scroll object or some different object because it should be notified whenever the ImageDraw method paints an image.

If that is the case then how do I get scroll object into there? If not and you know the reason for this I would be very thankful for your help.

here is a screen shot of my problem:
http://img39.imageshack.us/i/40555555.jpg/



 
Rob Camick
Ranch Hand
Posts: 2700
10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need super.paintComponent() at the start of the method.
 
Ignas Sliuzas
Greenhorn
Posts: 13
Firefox Browser Java Notepad
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks a lot, can't believe I've missed it. Still quite strange that it pretty much worked normal without it.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!