This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

java swing

 
puneetRatikon agarwal
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how to change JButton background color???
 
Rob Spoor
Sheriff
Pie
Posts: 20495
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
http://faq.javaranch.com/java/UseAMeaningfulSubjectLine. This sub forum is almost entirely about Java and Swing - the AWT, SWT and JFace threads are practically absent compared to the Swing threads.

Try checking the API: javax.swing.JButton. You search for something like "background". You find nothing declared by JButton itself, but wait! there is a method called setBackground in JComponent. And lo and behold:
Sets the background color of this component.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic