Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How do I bringup a color palette with the click of a button  RSS feed

 
Meghna ks
Ranch Hand
Posts: 122
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
I need to bring up a color palette when I press a button & must be able to select a color in the palette & return it back to a textfield's background color to the color that I select within the palette. How can this be done ?!!
Thanks
Meghna
 
Manfred Leonhardt
Ranch Hand
Posts: 1492
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Meghna,
Would using the Swing component
javax.swing.JColorChooser
be to easy?
Regards,
Manfred.
 
Meghna ks
Ranch Hand
Posts: 122
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ManFred
Thanks. But, I could'nt figure out a way about using the javax.swing.JColorChooser package. It would be great if you've come across any sample code that can be posted in here.
Thanks
Meghna
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here's Sun's section on How to Use ColorChoosers in the Java Tutorial chapter on constructing GUIs in Swing...
 
Meghna ks
Ranch Hand
Posts: 122
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks ManFred & Nathan
I did look into the link and was able to solve the problem.
I appreciate all the help.
Thanks again
Meghna
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!