本文整理匯總了Java中org.jdesktop.swingx.JXTable.setEnabled方法的典型用法代碼示例。如果您正苦於以下問題:Java JXTable.setEnabled方法的具體用法?Java JXTable.setEnabled怎麽用?Java JXTable.setEnabled使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.jdesktop.swingx.JXTable
的用法示例。
在下文中一共展示了JXTable.setEnabled方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: interactiveRolloverHighlight
import org.jdesktop.swingx.JXTable; //導入方法依賴的package包/類
/**
* Plain RolloverHighlighter.
* Issue #513-swingx: no rollover effect for disabled table.
*
*/
public void interactiveRolloverHighlight() {
final JXTable table = new JXTable(tableModel);
ColorHighlighter colorHighlighter = new ColorHighlighter(HighlightPredicate.ROLLOVER_ROW, Color.YELLOW, null);
table.addHighlighter(colorHighlighter);
Action action = new AbstractAction("toggle table enabled") {
@Override
public void actionPerformed(ActionEvent e) {
table.setEnabled(!table.isEnabled());
}
};
JXFrame frame = showWithScrollingInFrame(table, "rollover highlight, enabled/disabled table");
addAction(frame, action);
frame.pack();
}
示例2: interactiveRolloverDisabledClickTable
import org.jdesktop.swingx.JXTable; //導入方法依賴的package包/類
/**
* Issue #1374-swingx: Rollover click must be disabled if target disabled
*
* Visual test for JXTable, adapted from reporter's test case
*/
public void interactiveRolloverDisabledClickTable() {
JXTable table = new JXTable(new AncientSwingTeam());
table.setEditable(false);
table.setEnabled(false);
final JXFrame frame = showWithScrollingInFrame(table, "disable table must not trigger rollover renderer");
// rollover-enabled default renderer
DefaultTableRenderer renderer = new DefaultTableRenderer() {
@Override
public void doClick() {
JOptionPane.showMessageDialog(frame, "Click");
}
@Override
public boolean isEnabled() {
return true;
}
};
table.setDefaultRenderer(Object.class, renderer);
addEnabledToggle(frame, table);
}
示例3: interactiveDisabledCollectionViews
import org.jdesktop.swingx.JXTable; //導入方法依賴的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);
}
示例4: testDynamicDisabled
import org.jdesktop.swingx.JXTable; //導入方法依賴的package包/類
/**
* Tests that enabled property of table and column control is synched dynamically.
*/
@Test
public void testDynamicDisabled() {
JXTable table = new JXTable(10, 3);
table.setColumnControlVisible(true);
assertEquals(table.isEnabled(), table.getColumnControl().isEnabled());
table.setEnabled(!table.isEnabled());
assertEquals(table.isEnabled(), table.getColumnControl().isEnabled());
}
示例5: testInitialDisabled
import org.jdesktop.swingx.JXTable; //導入方法依賴的package包/類
/**
* suspected: enabled not synched on init.
* But is (done in ccb.installTable()).
*
*/
@Test
public void testInitialDisabled() {
JXTable table = new JXTable(10, 3);
table.setEnabled(false);
table.setColumnControlVisible(true);
assertEquals(table.isEnabled(), table.getColumnControl().isEnabled());
}