Get the tools you need to learn Java skills fast!
Video tutorials, eBooks, hands-on lab exercises, sample code.
Get started
The moose likes Swing / AWT / SWT and the fly likes JLabel setBackround Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Badass: Making Users Awesome this week in the Game Development forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JLabel setBackround" Watch "JLabel setBackround" New topic

JLabel setBackround

simon keillor

Joined: Jun 23, 2004
Posts: 24

Have a JLabel with some text in. Can change the colour of the text, but only seem able to change the backgroud to black or white. Code I use is as follows (the class extends a JLabel, actionPerformed relates to a PopUpMenu from the JLabel)

Is there some restriction on the background color of JLabels, or have I missed something screamingly obvious



simon keillor

Joined: Jun 23, 2004
Posts: 24

Just looking throught my code again, when I set my action command for that menu item I'd mispelled the word orange (had put ornage).

Monday morning, brain not in gear yet (my excuse anyway!!)

Thanks for taking a look anyway.

Dirk Schreckmann

Joined: Dec 10, 2001
Posts: 7023
I'm glad we could help out as your Cardboard Analyst.

I'm moving this to the Swing / JFC / AWT forum...

[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
I agree. Here's the link:
subject: JLabel setBackround