How do you change border of the pop up section of a JComboBox?

前端 未结 1 489
温柔的废话
温柔的废话 2020-12-22 01:35

I wan\'t to change the border of the popup/selection part of the JComboBox.

Note that the UI is BasicComboBoxUI

I\'ve tried:

weaponCB.setRend         


        
1条回答
  •  醉梦人生
    2020-12-22 01:35

    Something like this works:

    Object child = comboBox.getAccessibleContext().getAccessibleChild(0);
    BasicComboPopup popup = (BasicComboPopup)child;
    JList list = popup.getList();
    list.setBorder( whiteBorder );
    

    0 讨论(0)
提交回复
热议问题