我不想改变JComboBox的弹出/选择部分的边框。如何更改JComboBox的弹出部分的边框?
注意,UI是BasicComboBoxUI
我已经试过:
weaponCB.setRenderer(new DefaultListCellRenderer() {
@Override
public void paint(Graphics g) {
setBorder(whiteBorder)
//whiteBorder is a white border
super.paint(g);
}
});
,但它给了我这个:
和:
for (int i=0; i<weaponCB.getComponentCount(); i++)
{
if (weaponCB.getComponent(i) instanceof AbstractButton)
{
((AbstractButton)weaponCB.getComponent(i)).setBorder(whiteBorder);
}
}
,但它给了我这个:
我想要的是这样的:(它是在Photoshop中完成的) 我不介意,如果它不完全一样,我只是想它不相似。
没有人有任何想法如何做到这一点?
有趣的问题+1 – mKorbel 2012-02-17 08:39:08