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


Java JXTable.setEnabled方法代碼示例

本文整理匯總了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();
}
 
開發者ID:RockManJoe64,項目名稱:swingx,代碼行數:23,代碼來源:HighlighterClientVisualCheck.java

示例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);
}
 
開發者ID:RockManJoe64,項目名稱:swingx,代碼行數:26,代碼來源:RolloverVisualCheck.java

示例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);
        
    }
 
開發者ID:RockManJoe64,項目名稱:swingx,代碼行數:35,代碼來源:RendererVisualCheck.java

示例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());
}
 
開發者ID:RockManJoe64,項目名稱:swingx,代碼行數:12,代碼來源:ColumnControlButtonTest.java

示例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());
}
 
開發者ID:RockManJoe64,項目名稱:swingx,代碼行數:13,代碼來源:ColumnControlButtonTest.java


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