• 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
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

Painting to a specific component

 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey all,
Actually I wish to draw a set of images to the screen, each into its own panel. I have the layout manager and components all set up, but how do I tell a paint() method or drawImage() call which specific component I wish to send it to?
All help appreciated...
Mark
 
Ranch Hand
Posts: 165
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hmm, to draw an image on a component you should have an access to this component's Graphics representation.
So, if you want to draw an image per component, modify it's update(Graphics) method.

That's it. In the case above image should be preloaded.

------------------
With best of best regards, Pawel S. Veselov ( aka Black Angel )
 
Ranch Hand
Posts: 111
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

This topic is very similar to the question I have. I am working in VAJ. I have several components in a container already (I have no control over the container The top level was provide by VAJ when I set up the Applet. I want to isolate an area in this container and draw a set of images to that area. The images are stored in an array that was loaded from a directory during initialization.
The number of images can vary each time repaint() occurs, but basically I want them displayed side to side one after the other.
I tried setting up a panel and drawing the images to that, but it didn't work.
Does anyone have any suggestion.?
 
I wasn't selected to go to mars. This tiny ad got in ahead of me:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic