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 can i change the Color of Images on JComponent

 
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
How do i change the color of Image on my JComponent.I placing an Image on JComponent through setIcon() method and passing ImageICon object.How can i change the color of the image which i passed to this Image Object.Or please sussest me any better way of doiing it.
I will be knowing the colors only at runTime.
here is my code which will explain easy to understand...
Say ...
JLabel label=new JLabel("My text");
ImageIcon icon=new IMageIcon("myImage.gif");
label.setIcon(icon);
now how can i change the color of this image in runtime.
 
Ranch Hand
Posts: 351
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
hey.. let us know your true name before the teacher punishes you !
Leena
 
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Howdy hiThere for u r answers,
Welcome to JavaRanch!
We ain't got many rules 'round these parts, but we do got one. Please change your display name to comply with The JavaRanch Naming Policy.
Note that you don't have to use your true name, just one that follows the naming policy.
Thanks Pardner! Hope to see you 'round the Ranch!
 
"The Hood"
Posts: 8521
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Please do not cross post. Continue the conversation here.
 
Consider Paul's rocket mass heater.
    Bookmark Topic Watch Topic
  • New Topic