下面列出了怎么用javax.swing.plaf.basic.BasicListUI的API类实例代码及写法,或者点击链接到github查看源代码。
@Override
public void setUI(ListUI ui) {
if (ui != null && Registry.is("ide.wide.selection.list.ui")) {
Class<? extends ListUI> type = ui.getClass();
if (type == BasicListUI.class) {
ui = new WideSelectionListUI();
}
}
super.setUI(ui);
}
HackComboBoxPopup(ComboBoxButtonImpl button) {
myButton = button;
// some ui register listeners to JList of popup
// just return dummy instance
// also override default UI since, some ui like Aqua can just skip list if is not aqua list ui
myDummyList.setUI(new BasicListUI());
}
/**
* Returns a new instance of {@code BasicListUI}. {@code BasicListUI} delegates are allocated one per {@code
* JList}*.
*
* @param list a component
* @return a new {@code ListUI} implementation for the Windows look and feel.
*/
public static ComponentUI createUI(final JComponent list) {
return new BasicListUI();
}
/**
* Returns a new instance of BasicListUI. BasicListUI delegates are
* allocated one per JList.
*
* @return A new ListUI implementation for the Windows look and feel.
*/
public static ComponentUI createUI(JComponent list) {
return new BasicListUI();
}