Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / GUI / July 2004

Tip: Looking for answers? Try searching our database.

Menu Renderer

Thread view: 
jacov - 26 Jul 2004 15:36 GMT
HI folks,
does anyone knows how to change a menuItem component.
e.g. i would like to have a menu with bacground = black and foreground
white....
Some suggestion? Thanks a lot
jacov
Thomas Fritsch - 27 Jul 2004 16:10 GMT
> HI folks,
> does anyone knows how to change a menuItem component.
> e.g. i would like to have a menu with bacground = black and foreground
> white....
> Some suggestion? Thanks a lot
> jacov

Hi Jakov!
All the menu-related Swing classes (JMenu, JMenuItem, JMenuBar)
indirectly extend from JComponent and Component.
So you can simply call setBackground(Color.black) and
setForeground(Color.white) on them.

Signature

Thomas<dot>Fritsch<squiggle>ops<dot>de

jacov - 27 Jul 2004 16:08 GMT
Oh yes it's the first thing i tried. But it doesn't work...
I don't know why...
Anyway thanks a lot

>> HI folks,
>> does anyone knows how to change a menuItem component.
[quoted text clipped - 8 lines]
> So you can simply call setBackground(Color.black) and
> setForeground(Color.white) on them.
ak - 27 Jul 2004 16:21 GMT
> Oh yes it's the first thing i tried. But it doesn't work...
> I don't know why...
did you tried setOpaque(true)?

Signature

Andrei Kouznetsov
http://uio.dev.java.net Unified I/O for Java
http://reader.imagero.com Java image reader

jacov - 29 Jul 2004 15:44 GMT
The first suggestions was the right.
Now it works fine!!
Sorry

>>Oh yes it's the first thing i tried. But it doesn't work...
>>I don't know why...
>
> did you tried setOpaque(true)?


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.