本文整理匯總了Java中de.invation.code.toval.graphic.renderer.AlternatingRowColorListCellRenderer類的典型用法代碼示例。如果您正苦於以下問題:Java AlternatingRowColorListCellRenderer類的具體用法?Java AlternatingRowColorListCellRenderer怎麽用?Java AlternatingRowColorListCellRenderer使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
AlternatingRowColorListCellRenderer類屬於de.invation.code.toval.graphic.renderer包,在下文中一共展示了AlternatingRowColorListCellRenderer類的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getListActivities
import de.invation.code.toval.graphic.renderer.AlternatingRowColorListCellRenderer; //導入依賴的package包/類
private JList getListActivities() {
if (listActivities == null) {
listActivities = new JList(modelListActivities);
listActivities.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
listActivities.setCellRenderer(new AlternatingRowColorListCellRenderer());
listActivities.setFixedCellHeight(20);
listActivities.setVisibleRowCount(10);
listActivities.getSelectionModel().setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
listActivities.setBorder(null);
for (String activity : getDialogObject().getActivities()) {
modelListActivities.addElement(activity);
}
listActivities.setSelectedIndex(0);
listActivities.addListSelectionListener(new ListSelectionListener() {
@Override
public void valueChanged(ListSelectionEvent e) {
if ((e.getValueIsAdjusting() == false) && (listActivities.getSelectedValue() != null)) {
updateListConstraints();
}
}
}
);
}
return listActivities;
}
示例2: getListConstraints
import de.invation.code.toval.graphic.renderer.AlternatingRowColorListCellRenderer; //導入依賴的package包/類
private JList getListConstraints() {
if (listConstraints == null) {
listConstraints = new JList(modelListConstraints);
listConstraints.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
listConstraints.setCellRenderer(new AlternatingRowColorListCellRenderer());
listConstraints.setFixedCellHeight(20);
listConstraints.setVisibleRowCount(10);
listConstraints.getSelectionModel().setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
listConstraints.setBorder(null);
}
return listConstraints;
}