
如图中,自定义菜单,其边框怎么也去不掉,想将其设置与背景同色也做不到?
用过的方法:
this.setUI(new MenuUI(uiBackgroung, uiForeground));
this.addActionListener(listener);// 估计响应被菜单内部事件先截 了,没有响应
this.setBorder(BorderFactory.createLineBorder(background,0));
// this.setBorder(BorderFactory.createBevelBorder(0));
// this.setBorderPainted(false);
this.setFocusPainted(false);
在JMenu和JMenuItem中都试过了?
这条线到底是谁的?