• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java JXFrame类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.jdesktop.swingx.JXFrame的典型用法代码示例。如果您正苦于以下问题:Java JXFrame类的具体用法?Java JXFrame怎么用?Java JXFrame使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



JXFrame类属于org.jdesktop.swingx包,在下文中一共展示了JXFrame类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: interactiveRolloverHighlight

import org.jdesktop.swingx.JXFrame; //导入依赖的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: interactiveIconTextAlignmentAndExtendsOpacity

import org.jdesktop.swingx.JXFrame; //导入依赖的package包/类
/**
 * Requirement: left aligned icon and right aligned text.
 * http://forums.java.net/jive/thread.jspa?messageID=398448#398448
 * 
 * Issue #1309-swingx: WrappingProvider needs option to "highlight" the icon as well.
 */
public void interactiveIconTextAlignmentAndExtendsOpacity() {
    ListModel files = createFileListModel();
    final JXList list = new JXList(files);
    ComponentProvider<?> text = new LabelProvider(StringValues.FILE_NAME, JLabel.TRAILING);
    final WrappingProvider wrapper = new WrappingProvider(IconValues.FILE_ICON, text, true);
    wrapper.setExtendsComponentOpacity(true);
    list.setCellRenderer(new DefaultListRenderer(wrapper));
    list.addHighlighter(HighlighterFactory.createSimpleStriping());
    JXFrame frame =showWithScrollingInFrame(list, "alignment in wrappingProvider");
    Action action = new AbstractAction("toggle icon opacity") {
        
        @Override
        public void actionPerformed(ActionEvent e) {
            wrapper.setExtendsComponentOpacity(!wrapper.getExtendsComponentOpacity());
            list.repaint();
        }
    };
    addAction(frame, action);
    JLabel label = new JLabel(IconValues.FILE_ICON.getIcon(list.getElementAt(1)));
    addStatusComponent(frame, label);
}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:28,代码来源:RendererVisualCheck.java


示例3: interactiveTableCompareFocusedCellBackground

import org.jdesktop.swingx.JXFrame; //导入依赖的package包/类
/**
 * Compare core table using core default renderer vs. swingx default renderer.<p>
 * Unselected background of lead is different for editable/not-editable cells.
 */
@SuppressWarnings("deprecation")
public void interactiveTableCompareFocusedCellBackground() {
    TableModel model = new AncientSwingTeam() {
        @Override
        public boolean isCellEditable(int row, int column) {
            return column != 0;
        }
    };
    
    JTable xtable = new JTable(model);
    xtable.setBackground(HighlighterFactory.NOTEPAD); // ledger
    JTable table = new JTable(model);
    table.setBackground(new Color(0xF5, 0xFF, 0xF5)); // ledger
    TableCellRenderer renderer = new DefaultTableRenderer();
    table.setDefaultRenderer(Object.class, renderer);
    JXFrame frame = wrapWithScrollingInFrame(xtable, table, "JTable: Unselected focused background: core/ext renderer");
    addStatusComponent(frame, new JLabel("background for unselected lead: first column is not-editable"));    
    show(frame);
}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:24,代码来源:RendererVisualCheck.java


示例4: interactiveTableCustomColorRendererWithHighlighter

import org.jdesktop.swingx.JXFrame; //导入依赖的package包/类
/**
 * Compare xtable using custom color renderer - standard vs. ext.<p>
 * Adds highlighter ... running amok.
 */
public void interactiveTableCustomColorRendererWithHighlighter() {
    TableModel model = new AncientSwingTeam();
    JXTable xtable = new JXTable(model);
    xtable.addHighlighter(
            HighlighterFactory.createSimpleStriping(HighlighterFactory.GENERIC_GRAY));
    xtable.setDefaultRenderer(Color.class, new ColorRenderer(true));
    JXTable table = new JXTable(model);
    table.addHighlighter(
            HighlighterFactory.createSimpleStriping(HighlighterFactory.GENERIC_GRAY));
    TableCellRenderer renderer = createColorRendererExt();
    table.setDefaultRenderer(Color.class, renderer);
    JXFrame frame = wrapWithScrollingInFrame(xtable, table, "JXTable/highlighter: Custom color renderer - standard/ext");
    addStatusMessage(frame, "Highlighter hide custom color renderer background for unselected");
    frame.setVisible(true);
}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:20,代码来源:RendererVisualCheck.java


示例5: interactiveTableCustomColorRendererWithHighlighterDontTouch

import org.jdesktop.swingx.JXFrame; //导入依赖的package包/类
/**
 * Compare xtable using custom color renderer - standard vs. ext.<p>
 * Adds highlighter which respects renderer's dont touch.
 */
public void interactiveTableCustomColorRendererWithHighlighterDontTouch() {
    TableModel model = new AncientSwingTeam();
    JXTable xtable = new JXTable(model);
    Highlighter highlighter = createPropertyRespectingHighlighter(
            HighlighterFactory.createSimpleStriping(HighlighterFactory.GENERIC_GRAY));

    xtable.addHighlighter(highlighter);
    xtable.setDefaultRenderer(Color.class, new ColorRenderer(true));
    JXTable table = new JXTable(model);
    table.addHighlighter(highlighter);
    TableCellRenderer renderer = createColorRendererExt();
    table.setDefaultRenderer(Color.class, renderer);
    JXFrame frame = wrapWithScrollingInFrame(xtable, table, "JXTable/highlighter dont-touch: Custom color renderer - standard/ext");
    addStatusMessage(frame, "Highlighter doesn't touch custom color renderer visual properties");
    frame.pack();
    frame.setVisible(true);
}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:22,代码来源:RendererVisualCheck.java


示例6: interactiveTableAndTreeCustomColorRenderingController

import org.jdesktop.swingx.JXFrame; //导入依赖的package包/类
/**
 * xtable/xlist using the same custom component controller.<p>
 * 
 */
public void interactiveTableAndTreeCustomColorRenderingController() {
    TableModel tableModel = new AncientSwingTeam();
    ComponentProvider<JLabel> controller = createColorRenderingLabelController();
    JXTable xtable = new JXTable(tableModel);
    xtable.setDefaultRenderer(Color.class, new DefaultTableRenderer(controller));
    TreeModel model = createTreeColorModel();
    JTree tree = new JTree(model);
    ComponentProvider<?> wrapper = new WrappingProvider(controller); //;createColorRenderingLabelController());
    TreeCellRenderer renderer = new DefaultTreeRenderer(wrapper);
    tree.setCellRenderer(renderer);
    JXFrame frame = wrapWithScrollingInFrame(xtable, tree, "JXTable/JXTree: Custom color renderer - sharing the component controller");
    addMessage(frame, "share provider in table and in wrappingProvider does not work?");
    frame.pack();
    frame.setVisible(true);
}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:20,代码来源:RendererVisualCheck.java


示例7: interactiveDropOnHierachicalColumnBlinks

import org.jdesktop.swingx.JXFrame; //导入依赖的package包/类
/**
 * Issue #766-swingx: drop image is blinking over hierarchical column.
 * 
 * Core bug: <a
 * href="http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6700748">#6700748</a>
 * 
 * Hacks around, use one or other: 
 * - the usual performance optimization (override validate etc to do nothing) 
 * - rendering component return false on isVisible
 */
public void interactiveDropOnHierachicalColumnBlinks() {
    JXTreeTable xTable = new JXTreeTable(new ComponentTreeTableModel(
            new JXFrame()));
    installTransferHandler(xTable);
    xTable.putClientProperty(JXTreeTable.DROP_HACK_FLAG_KEY, Boolean.TRUE);
    xTable.expandAll();
    xTable.setVisibleColumnCount(10);
    JXFrame frame = wrapWithScrollingInFrame(xTable,
            "TreeTable hierarchical: blink on drop over?");
    JTextField textField = new JTextField(
            "drag me over hierarchical column ..");
    textField.setDragEnabled(true);
    addStatusComponent(frame, textField);
    frame.setVisible(true);
}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:26,代码来源:DNDRendererVisualCheck.java


示例8: interactiveDropOnPlainLabelTableBlinks

import org.jdesktop.swingx.JXFrame; //导入依赖的package包/类
/**
 * Issue #766-swingx: drop image is blinking over hierarchical column.
 * 
 * Check plain JLabel as renderer in Table.
 */
public void interactiveDropOnPlainLabelTableBlinks() {
    JXTable xTable = new JXTable(new AncientSwingTeam());
    installTransferHandler(xTable);
    TableCellRenderer renderer = new TableCellRenderer() {
        JLabel label = new JLabel();
        public Component getTableCellRendererComponent(JTable table,
                Object value, boolean isSelected, boolean hasFocus,
                int row, int column) {
            label.setText(String.valueOf(value));
            return label;
        }
        
    };
    xTable.getColumn(0).setCellRenderer(renderer);
    JXFrame frame = wrapWithScrollingInFrame(xTable,
    "Plain label as renderer: blink on drop over?");
    JTextField textField = new JTextField("drag me over first column....");
    textField.setDragEnabled(true);
    addStatusComponent(frame, textField);
    frame.setVisible(true);
}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:27,代码来源:DNDRendererVisualCheck.java


示例9: interactiveDropOnVisualsTable

import org.jdesktop.swingx.JXFrame; //导入依赖的package包/类
/**
     * Issue #370-swingx: drop-on not shown correctly.
     * 
     * Check core default renderer as renderer in Table.
     */
    public void interactiveDropOnVisualsTable() {
        JXTable xTable = new JXTable(new AncientSwingTeam());
        installTransferHandler(xTable);
        xTable.getColumn(0).setCellRenderer(new DefaultTableCellRenderer());
        JTable table = new JTable(new AncientSwingTeam());
        installTransferHandler(table);
//        xTable.setDropMode(DropMode.USE_SELECTION);
//        table.setDropMode(DropMode.USE_SELECTION);
        xTable.setDropMode(DropMode.ON_OR_INSERT);
        table.setDropMode(DropMode.ON_OR_INSERT);
        JXFrame frame = wrapWithScrollingInFrame(xTable, table,
                "JXTable (first column core renderer) <-> core table: drop-on appearance");
        JTextField textField = new JTextField("drag me over first column....");
        textField.setDragEnabled(true);
        addStatusComponent(frame, textField);
        show(frame);
    }
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:23,代码来源:DNDRendererVisualCheck.java


示例10: interactiveDropOnVisualsList

import org.jdesktop.swingx.JXFrame; //导入依赖的package包/类
/**
     * Issue #370-swingx: drop-on not shown correctly.
     * 
     * Check core default renderer as renderer in Table.
     */
    public void interactiveDropOnVisualsList() {
        JXList xTable = new JXList(AncientSwingTeam.createNamedColorListModel());
        installTransferHandler(xTable);
        JList table = new JList(xTable.getModel());
        installTransferHandler(table);
//        xTable.setDropMode(DropMode.USE_SELECTION);
//        table.setDropMode(DropMode.USE_SELECTION);
        xTable.setDropMode(DropMode.ON_OR_INSERT);
        table.setDropMode(DropMode.ON_OR_INSERT);
        JXFrame frame = wrapWithScrollingInFrame(xTable, table,
                "JXList <-> core list: drop-on appearance");
        JTextField textField = new JTextField("drag me over first column....");
        textField.setDragEnabled(true);
        addStatusComponent(frame, textField);
        show(frame);
    }
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:22,代码来源:DNDRendererVisualCheck.java


示例11: interactiveDropOnVisualsTree

import org.jdesktop.swingx.JXFrame; //导入依赖的package包/类
/**
     * Issue #370-swingx: drop-on not shown correctly.
     * 
     * Check core default renderer as renderer in Table.
     */
    public void interactiveDropOnVisualsTree() {
        JXTree xTable = new JXTree(AncientSwingTeam.createNamedColorTreeModel());
        installTransferHandler(xTable);
        xTable.setCellRenderer(new DefaultTreeRenderer());
        JTree table = new JTree(xTable.getModel());
        installTransferHandler(table);
//        xTable.setDropMode(DropMode.USE_SELECTION);
//        table.setDropMode(DropMode.USE_SELECTION);
        xTable.setDropMode(DropMode.ON_OR_INSERT);
        table.setDropMode(DropMode.ON_OR_INSERT);
        JXFrame frame = wrapWithScrollingInFrame(xTable, table,
                "JXTree <-> core tree: drop-on appearance");
        JTextField textField = new JTextField("drag me over first column....");
        textField.setDragEnabled(true);
        addStatusComponent(frame, textField);
        show(frame);
    }
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:23,代码来源:DNDRendererVisualCheck.java


示例12: interactiveIconPainterHighlight

import org.jdesktop.swingx.JXFrame; //导入依赖的package包/类
/**
 * Use highlighter with background image painter. Shared by table and list.
 */
public void interactiveIconPainterHighlight() throws Exception {
    TableModel model = new AncientSwingTeam();
    JXTable table = new JXTable(model);
    ComponentProvider<JLabel> controller = new LabelProvider(
            JLabel.RIGHT);
    table.getColumn(0).setCellRenderer(
            new DefaultTableRenderer(controller));
    final ImagePainter imagePainter = new ImagePainter(XTestUtils.loadDefaultImage());
    HighlightPredicate predicate = new ColumnHighlightPredicate(0);
    Highlighter iconHighlighter = new PainterHighlighter(predicate, imagePainter );
    Highlighter alternateRowHighlighter = HighlighterFactory.createSimpleStriping();
    table.addHighlighter(alternateRowHighlighter);
    table.addHighlighter(iconHighlighter);
    // re-use component controller and highlighter in a JXList
    JXList list = new JXList(createListNumberModel(), true);
    list.setCellRenderer(new DefaultListRenderer(controller));
    list.addHighlighter(alternateRowHighlighter);
    list.addHighlighter(iconHighlighter);
    list.toggleSortOrder();
    final JXFrame frame = showWithScrollingInFrame(table, list,
            "image highlighting plus striping");
    frame.pack();
}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:27,代码来源:PainterVisualCheck.java


示例13: interactiveValueBasedGradientHighlightPlusStriping

import org.jdesktop.swingx.JXFrame; //导入依赖的package包/类
/**
     * Use transparent gradient painter for value-based background highlighting
     * with SwingX extended default renderer. Shared by table and list with
     * striping.
     */
    public void interactiveValueBasedGradientHighlightPlusStriping() {
        TableModel model = new AncientSwingTeam();
        JXTable table = new JXTable(model);
        ComponentProvider<JLabel> controller = new LabelProvider(
                JLabel.RIGHT) ;
        RelativePainterHighlighter gradientHighlighter = 
            createRelativeGradientHighlighter(HorizontalAlignment.RIGHT, 100);
        table.addHighlighter(gradientHighlighter);
        Highlighter alternateRowHighlighter = HighlighterFactory.createSimpleStriping();
        table.addHighlighter(alternateRowHighlighter);
        table.addHighlighter(gradientHighlighter);
        // re-use component controller and highlighter in a JXList
        JXList list = new JXList(createListNumberModel(), true);
        list.setCellRenderer(new DefaultListRenderer(controller));
        list.addHighlighter(alternateRowHighlighter);
        list.addHighlighter(gradientHighlighter);
        list.toggleSortOrder();
        final JXFrame frame = wrapWithScrollingInFrame(table, list,
                "transparent value relative highlighting plus striping");
        addStatusMessage(frame,
                "uses a PainterAwareLabel in renderer");
        // crude binding to play with options - the factory is incomplete...
//        addStatusComponent(frame, createTransparencyToggle(gradientHighlighter));
//        show(frame);
    }
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:31,代码来源:PainterVisualCheck.java


示例14: interactiveXTreeLabelFormattingHighlighter

import org.jdesktop.swingx.JXFrame; //导入依赖的package包/类
/**
 * Custom format on JTree/JXTree (latter with highlighter).
 *
 */
public void interactiveXTreeLabelFormattingHighlighter() {
    TreeModel model = createComponentHierarchyModel();
    JTree tree = new JTree(model);
    StringValue converter = new StringValue() {

        public String getString(Object value) {
            if (value instanceof Component) {
                return "Name: " + ((Component) value).getName();
            }
            return StringValues.TO_STRING.getString(value);
        }
        
    };
    tree.setCellRenderer(new DefaultTreeRenderer(converter));
    JXTree xtree = new JXTree(model);
    xtree.setHighlighters(new ColorHighlighter(HighlightPredicate.ROLLOVER_ROW, Color.RED,
            Color.YELLOW));
    xtree.setRolloverEnabled(true);
    // share renderer
    xtree.setCellRenderer(tree.getCellRenderer());
    final JXFrame frame = wrapWithScrollingInFrame(tree, xtree, "custom format - tree vs. xtree (+Rollover renderer)");
    frame.setVisible(true);
}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:28,代码来源:TreeRendererTest.java


示例15: interactiveCompareTreeExtTreeColors

import org.jdesktop.swingx.JXFrame; //导入依赖的package包/类
/**
 * Custom tree colors in JTree. Compare core default renderer with Swingx
 * default renderer.
 * 
 */
public void interactiveCompareTreeExtTreeColors() {
    JTree xtree = new JTree();
    Color background = Color.MAGENTA;
    Color foreground = Color.YELLOW;
    xtree.setBackground(background);
    xtree.setForeground(foreground);
    DefaultTreeCellRenderer coreTreeCellRenderer = new DefaultTreeCellRenderer();
    // to get a uniform color on both tree and node
    // the core default renderer needs to be configured
    coreTreeCellRenderer.setBackgroundNonSelectionColor(background);
    coreTreeCellRenderer.setTextNonSelectionColor(foreground);
    xtree.setCellRenderer(coreTreeCellRenderer);
    JTree tree = new JTree();
    tree.setBackground(background);
    tree.setForeground(foreground);
    // swingx renderer uses tree colors
    tree.setCellRenderer(xTreeRenderer);
    final JXFrame frame = wrapWithScrollingInFrame(xtree, tree,
            "custom tree colors - core vs. ext renderer");
    frame.setVisible(true);
}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:27,代码来源:TreeRendererTest.java


示例16: interactiveCompareTreeRToL

import org.jdesktop.swingx.JXFrame; //导入依赖的package包/类
/**
 * Component orientation in JTree. Compare core default renderer with Swingx
 * default renderer.
 * 
 */
public void interactiveCompareTreeRToL() {
    JTree xtree = new JTree();
    xtree.setCellRenderer(coreTreeRenderer);
    JTree tree = new JTree();
    tree.setCellRenderer(xTreeRenderer);
    final JXFrame frame = wrapWithScrollingInFrame(xtree, tree,
            "orientation - core vs. ext renderer");
    Action toggleComponentOrientation = new AbstractAction(
            "toggle orientation") {

        public void actionPerformed(ActionEvent e) {
            ComponentOrientation current = frame.getComponentOrientation();
            if (current == ComponentOrientation.LEFT_TO_RIGHT) {
                frame.applyComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);
            } else {
                frame.applyComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);
            }
        }

    };
    addAction(frame, toggleComponentOrientation);
    frame.setVisible(true);
}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:29,代码来源:TreeRendererTest.java


示例17: testFindDialogDispose

import org.jdesktop.swingx.JXFrame; //导入依赖的package包/类
/**
 * Issue #718-swingx: shared FindPanel not updated on LF change.
 * 
 * Here: check that containing dialog is disposed, new api with flag.
 */
@Test
public void testFindDialogDispose() {
    // This test will not work in a headless configuration.
    if (GraphicsEnvironment.isHeadless()) {
        LOG.fine("cannot run test - headless environment");
        return;
    }
    JXFrame frame = new JXFrame();
    JXTable table = new JXTable();
    frame.add(table);
    JComponent findPanel = SearchFactory.getInstance().getSharedFindPanel();
    SearchFactory.getInstance().showFindDialog(table, table.getSearchable());
    Window window = SwingUtilities.getWindowAncestor(findPanel);
    assertSame(frame, window.getOwner());
    SearchFactory.getInstance().hideSharedFindPanel(true);
    assertFalse("window must not be displayable", window.isDisplayable());
    assertNull("findPanel must be unparented", findPanel.getParent());
}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:24,代码来源:FindTest.java


示例18: testFindDialogHide

import org.jdesktop.swingx.JXFrame; //导入依赖的package包/类
/**
 * Issue #718-swingx: shared FindPanel not updated on LF change.
 * 
 * Here: check that containing dialog is not disposed.
 */
@Test
public void testFindDialogHide() {
    // This test will not work in a headless configuration.
    if (GraphicsEnvironment.isHeadless()) {
        LOG.fine("cannot run test - headless environment");
        return;
    }
    JXFrame frame = new JXFrame();
    JXTable table = new JXTable();
    frame.add(table);
    JComponent findPanel = SearchFactory.getInstance().getSharedFindPanel();
    SearchFactory.getInstance().showFindDialog(table, table.getSearchable());
    Container parent = findPanel.getParent();
    Window window = SwingUtilities.getWindowAncestor(findPanel);
    assertSame(frame, window.getOwner());
    SearchFactory.getInstance().hideSharedFindPanel(false);
    assertFalse("window must not be visible", window.isVisible());
    assertSame("findPanel must parent must be unchanged", 
            parent, findPanel.getParent());
    assertTrue("window must be displayable", window.isDisplayable());
}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:27,代码来源:FindTest.java


示例19: testFindDialogNew

import org.jdesktop.swingx.JXFrame; //导入依赖的package包/类
/**
 * Issue #718-swingx: shared FindPanel not updated on LF change.
 * 
 * Here: check that dialog is new for different owner and old has been disposed.
 */
@Test
public void testFindDialogNew() {
    // This test will not work in a headless configuration.
    if (GraphicsEnvironment.isHeadless()) {
        LOG.fine("cannot run test - headless environment");
        return;
    }
    JXFrame frame = new JXFrame();
    JXTable table = new JXTable();
    frame.add(table);
    JComponent findPanel = SearchFactory.getInstance().getSharedFindPanel();
    // show search dialog for a searchable
    SearchFactory.getInstance().showFindDialog(table, table.getSearchable());
    Window window = SwingUtilities.getWindowAncestor(findPanel);
    assertSame(frame, window.getOwner());
    // setup of second searchable
    JXFrame second = new JXFrame();
    JXTree tree = new JXTree();
    second.add(tree);
    // show search dialog for a searchable
    SearchFactory.getInstance().showFindDialog(tree, tree.getSearchable());
    assertFalse("previous window must not be displayable", window.isDisplayable());
    assertSame(second, SwingUtilities.getWindowAncestor(findPanel).getOwner());
}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:30,代码来源:FindTest.java


示例20: interactiveTableRollover

import org.jdesktop.swingx.JXFrame; //导入依赖的package包/类
public void interactiveTableRollover() {
    JXTable table = new JXTable(sortableTableModel);
    final CompoundHighlighter compoundHighlighter = new CompoundHighlighter(foregroundHighlighter);
    table.setHighlighters(compoundHighlighter);
    JXFrame frame = wrapWithScrollingInFrame(table, "Table with rollover");
    Action toggleAction = new AbstractAction("toggle foreground/background") {
        boolean isBackground;
        public void actionPerformed(ActionEvent e) {
            if (isBackground) {
                compoundHighlighter.addHighlighter(foregroundHighlighter);
                compoundHighlighter.removeHighlighter(backgroundHighlighter);
            } else {
                compoundHighlighter.addHighlighter(backgroundHighlighter);
                compoundHighlighter.removeHighlighter(foregroundHighlighter);
                
            }
            isBackground = !isBackground;
            
        }
        
    };
    addAction(frame, toggleAction);
    frame.setVisible(true);
}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:25,代码来源:RolloverVisualCheck.java



注:本文中的org.jdesktop.swingx.JXFrame类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ExpressionFactoryImpl类代码示例发布时间:2022-05-22
下一篇:
Java VariantContextWriterBuilder类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap