Package javax.swing.table

Examples of javax.swing.table.DefaultTableCellRenderer


        // No keystroke controls here:
        setFocusable(false);

        setDefaultRenderer(
            Object.class,
            new DefaultTableCellRenderer() {
                private Color NormalColor = getBackground();
                public Component getTableCellRendererComponent(
                    JTable table,
                    Object value,
                    boolean isSelected,
View Full Code Here


    comboBox.addItem("Speed reading");
    comboBox.addItem("Pool");
    comboBox.addItem("None of the above");
    sportColumn.setCellEditor(new DefaultCellEditor(comboBox));
    // Set up tool tips for the sport cells.
    DefaultTableCellRenderer renderer = new DefaultTableCellRenderer();
    renderer.setToolTipText("Click for combo box");
    sportColumn.setCellRenderer(renderer);
  }
View Full Code Here

    comboBox.addItem("Speed reading");
    comboBox.addItem("Pool");
    comboBox.addItem("None of the above");
    sportColumn.setCellEditor(new DefaultCellEditor(comboBox));
    // Set up tool tips for the sport cells.
    DefaultTableCellRenderer renderer = new DefaultTableCellRenderer();
    renderer.setToolTipText("Click for combo box");
    sportColumn.setCellRenderer(renderer);
  }
View Full Code Here

        .getProbabilityHighlighter(tableOrders, "Sannsynlighet"));

    tableOrders.setShowGrid(true);
    tableOrders.setRolloverEnabled(false);

    DefaultTableCellRenderer renderer = new DefaultTableCellRenderer();
    renderer.setHorizontalAlignment(SwingConstants.CENTER);
    Font font = renderer.getFont().deriveFont(Font.BOLD);

    renderer.setFont(font);
    tableOrders.getColumnModel().getColumn(2).setCellRenderer(renderer);
    tableOrders.setDefaultRenderer(String.class, renderer);

    addMenuListeners(window);
View Full Code Here

    /**
     * Build the delegate TableCellRenderer that handles rendering the data of
     * each tree node.
     */
    protected TableCellRenderer createDelegateRenderer() {
        return new DefaultTableCellRenderer();
    }
View Full Code Here

         */
        private Component getDelegateTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
            try {
                return delegateRenderer.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
            } catch (RuntimeException e) {
                delegateRenderer = new DefaultTableCellRenderer();
                return delegateRenderer.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
            }
        }
View Full Code Here

        final String[] columnLabels = {"Column 1"};
        final TableFormat<String> itemTableFormat = GlazedLists.tableFormat(propertyNames, columnLabels);
        final EventTableModel<String> model = new EventTableModel<String>(treeList, itemTableFormat);
        final JTable table = new JTable(model);
        final TableColumn hierarchyColumn = table.getColumnModel().getColumn(0);
        final TableCellRenderer originalRenderer = new DefaultTableCellRenderer();
        final TableCellEditor originalEditor = new DefaultCellEditor(new JComboBox());
        hierarchyColumn.setCellRenderer(originalRenderer);
        hierarchyColumn.setCellEditor(originalEditor);

        // extract some information from the JTable before installing TreeTableSupport
View Full Code Here

        // install TreeTableSupport
        final TreeTableSupport support = TreeTableSupport.install(table, treeList, 0);
        final TableColumn hierarchyColumn = table.getColumnModel().getColumn(0);
        final TreeTableCellRenderer renderer = (TreeTableCellRenderer) hierarchyColumn.getCellRenderer();
        final TreeTableCellEditor editor = (TreeTableCellEditor) hierarchyColumn.getCellEditor();
        final TableCellRenderer newDelegateRenderer = new DefaultTableCellRenderer();
        final TableCellEditor newDelegateEditor = new DefaultCellEditor(new JComboBox());

        // installing new delegate renderers and editors should change them behind the TreeTableCellRenderer and TreeTableCellEditor
        assertNotSame(newDelegateRenderer, renderer.getDelegate());
        assertNotSame(newDelegateEditor, editor.getDelegate());
View Full Code Here

        downloadTable.setDefaultRenderer(JProgressBar.class, new ProgressRenderer(1000));
        downloadTable.setDefaultRenderer(ByteRateRenderer.class, new ByteRateRenderer());
        downloadTable.setDefaultRenderer(ByteRenderer.class, new ByteRenderer());
        downloadTable.setDefaultRenderer(ListRenderer.class, new ListRenderer());
        downloadTable.setDefaultRenderer(TimeRenderer.class, new TimeRenderer());
        downloadTable.setDefaultRenderer(String.class, new DefaultTableCellRenderer());
       
        downloadTable.getSelectionModel().addListSelectionListener(this);
        taskList.getSelectionModel().addListSelectionListener(this);
       
        tableSorter = TableComparatorChooser.install(downloadTable, downloads, TableComparatorChooser.MULTIPLE_COLUMN_MOUSE_WITH_UNDO, downloadFormat);
View Full Code Here

public class ByteRenderer extends DefaultTableCellRenderer implements TableCellRenderer {
   
    private DefaultTableCellRenderer renderer;
   
    public ByteRenderer() {
        renderer = new DefaultTableCellRenderer();
    }
View Full Code Here

TOP

Related Classes of javax.swing.table.DefaultTableCellRenderer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.