Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to remove/change color of top and bottom borders(?) of JMenu? (screenshot included)

 
Elemer Iszonyatos
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey!

Kinda hard to explain my problem, so here's a screenshot:
http://i.imgur.com/ASrRB.jpg

As you can see, there are white lines on the top and bottom of JMenuItem "About". I'd like to remove them, or change their color to the background's color (gray).
I tried everything. Both the JMenu's (Help) and JMenuItem's (About) borders are set to null and their colors set to gray. The white lines are still there and i have no idea what to do at this point, i can't even figure out what are those exactly.

I'd really appreciate any advice.
Thanks in advance!
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
in the absence of relevant info like
the look and feel you are using etc.,
about all I can suggest is to use the
right shade of tipex.
 
Elemer Iszonyatos
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey, thanks for your reply.

I'm using the default look and feel, just playing with the background- and foreground colors.
Both the JMenu and the JMenuItem background colors are set to Color.GRAY. The white lines didn't disappear so i assumed they're some kind of a border. Set both the JMenu and the JMenuItem borders to null, the white lines are still there.
There aren't any white lines between JMenuItems. If there are 5 JMenuItem in a JMenu, the white lines appear only on the top of the first JMenuItem, and the bottom of the last one.

Sorry, but i don't know what do you mean by the "right shade of tipex". Would you explain, please?

Thanks in advance!
 
Darryl Burke
Bartender
Posts: 5132
11
Java Netbeans IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Elemer Iszonyatos wrote:If there are 5 JMenuItem in a JMenu, the white lines appear only on the top of the first JMenuItem, and the bottom of the last one.

Could be the border of the JPopupMenu.
 
Elemer Iszonyatos
Greenhorn
Posts: 4
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Darryl Burke wrote:
Elemer Iszonyatos wrote:If there are 5 JMenuItem in a JMenu, the white lines appear only on the top of the first JMenuItem, and the bottom of the last one.

Could be the border of the JPopupMenu.

That was it! Thank you very much!
JMenu.getPopupMenu.setBorder(null) solved it.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic