Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to prevent image from disappearing?

 
Bobby Marvikuan
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
I have a class(very big) which draws an image using paintComponent method but when I am resizing the image disappears. Can anyone suggest me a way to prevent this? I cannot use method drawImage because it is looping through and draws each time a new square to make a crossword. So, if I would use it will draw each time a new Image is there a way to do that or no???
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
make a class (a very little class) - just a
frame and panel (for your drawing code).

make sure it demonstrates the same problem
then post that code.
 
Bobby Marvikuan
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Michael Dunn wrote:make a class (a very little class) - just a
frame and panel (for your drawing code).

make sure it demonstrates the same problem
then post that code.

Lol dunno this is what I get after decreasing
 
Darryl Burke
Bartender
Posts: 5148
11
Java Netbeans IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You say your problem is with drawing an image, but the code you posted doesn't have anything related to drawing an image.

It does have a whole nunch of unused imports which just add clutter, and would have been better removed before posting here.
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
> Lol dunno this is what I get after decreasing

keep going - you're 10% there.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic