• Post Reply Bookmark Topic Watch Topic
  • New Topic

A gray color box appear d when loading image on JPanel  RSS feed

 
Nikhil V G
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hai All,

I m nikhil. I have a Problem that when I load an image in to jpanel using drawImage method of Graphics class(G.drawImage(Image img,int width,int higth))...It take more time to load. When loading firts a gray color box will be appear on Frame. Then image loaded.How to avaoid this gray color. How to make it fast.

I think i will get a solution from javaranch.Thanks in advance.

Regards,
NIKHIL
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
depends a lot on how you are doing it, so post your code (or a sample program)
e.g. do not 'get' the image in paintComponent()
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!