aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes How to remove/change color of top and bottom borders(?) of JMenu? (screenshot included) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "How to remove/change color of top and bottom borders(?) of JMenu? (screenshot included)" Watch "How to remove/change color of top and bottom borders(?) of JMenu? (screenshot included)" New topic
Author

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

Elemer Iszonyatos
Greenhorn

Joined: Apr 21, 2012
Posts: 4
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

Joined: Jun 09, 2003
Posts: 4632
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

Joined: Apr 21, 2012
Posts: 4
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

Joined: May 03, 2008
Posts: 4546
    
    5

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.


luck, db
There are no new questions, but there may be new answers.
Elemer Iszonyatos
Greenhorn

Joined: Apr 21, 2012
Posts: 4
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.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: How to remove/change color of top and bottom borders(?) of JMenu? (screenshot included)