• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to draw a image in background

 
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I want to draw a image(map) in background. i want to know how to do?.Image size is more than 10 MB.
i wrote the below code inside paintComponent().But cursor is blinking between WAIT cursor and default.


[ September 29, 2004: Message edited by: Sivakumar Nachimuthu ]
 
Ranch Hand
Posts: 1535
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Take the setCursor calls and the image loading out of paintComponent.
You only need to load the image one time: at construction or via event code.
The cursor changes should go in your constructor–originated image–loading
code (before and after the loading) or in your equivalent event code. The code in
paintComponent should be limited to what is needed to render the image
once it is fully–loaded.
[ September 29, 2004: Message edited by: Craig Wood ]
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic