本文整理汇总了Java中org.jdesktop.swingx.JXList.setEnabled方法的典型用法代码示例。如果您正苦于以下问题:Java JXList.setEnabled方法的具体用法?Java JXList.setEnabled怎么用?Java JXList.setEnabled使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jdesktop.swingx.JXList
的用法示例。
在下文中一共展示了JXList.setEnabled方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: interactiveRolloverDisabledClickList
import org.jdesktop.swingx.JXList; //导入方法依赖的package包/类
/**
* Issue #1374-swingx: Rollover click must be disabled if target disabled
*
* Visual test for JXTable, adapted from reporter's test case
*/
public void interactiveRolloverDisabledClickList() {
JXList table = new JXList(AncientSwingTeam.createNamedColorListModel());
table.setEnabled(false);
table.setRolloverEnabled(true);
final JXFrame frame = showWithScrollingInFrame(table, "disable list must not trigger rollover renderer");
// rollover-enabled default renderer
DefaultListRenderer renderer = new DefaultListRenderer() {
@Override
public void doClick() {
JOptionPane.showMessageDialog(frame, "Click");
}
@Override
public boolean isEnabled() {
return true;
}
};
table.setCellRenderer(renderer);
addEnabledToggle(frame, table);
}
示例2: interactiveDisabledCollectionViews
import org.jdesktop.swingx.JXList; //导入方法依赖的package包/类
/**
* Issue #282-swingx: compare disabled appearance of
* collection views.
* Check if extended renderers behave correctly. Still open: header
* renderer disabled.
*/
public void interactiveDisabledCollectionViews() {
final JXTable table = new JXTable(new AncientSwingTeam());
// table.setDefaultRenderer(Object.class, new DefaultTableRenderer());
table.setEnabled(false);
final JXList list = new JXList(new String[] {"one", "two", "and something longer"});
list.setEnabled(false);
// list.setCellRenderer(new DefaultListRenderer());
final JXTree tree = new JXTree(new FileSystemModel());
tree.setEnabled(false);
JComponent box = Box.createHorizontalBox();
box.add(new JScrollPane(table));
box.add(new JScrollPane(list));
box.add(new JScrollPane(tree));
JXFrame frame = wrapInFrame(box, "disabled collection views");
AbstractAction action = new AbstractAction("toggle disabled") {
@Override
public void actionPerformed(ActionEvent e) {
table.setEnabled(!table.isEnabled());
list.setEnabled(!list.isEnabled());
tree.setEnabled(!tree.isEnabled());
}
};
addAction(frame, action);
frame.setVisible(true);
}