當前位置: 首頁>>代碼示例>>Java>>正文


Java AlternatingRowColorListCellRenderer類代碼示例

本文整理匯總了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;
}
 
開發者ID:iig-uni-freiburg,項目名稱:SEWOL,代碼行數:29,代碼來源:RoutingConstraintsDialog.java

示例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;
}
 
開發者ID:iig-uni-freiburg,項目名稱:SEWOL,代碼行數:13,代碼來源:RoutingConstraintsDialog.java


注:本文中的de.invation.code.toval.graphic.renderer.AlternatingRowColorListCellRenderer類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。