You would probably need to change opacity of menu items, ie:
JMenuItem item= new JMenuItem("Test");
item.setOpaque(true);
item.setBackground(Color.CYAN);
You can also achieve that globally using UIManager
, for example:
UIManager.put("MenuItem.background", Color.CYAN);
UIManager.put("MenuItem.opaque", true);
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…