Search in sources :

Example 86 with TableCellEditor

use of javax.swing.table.TableCellEditor in project jdk8u_jdk by JetBrains.

the class bug6711682 method createAndShowGUI.

private static void createAndShowGUI() {
    editorCb = new JCheckBox();
    rendererCb = new JCheckBox();
    JFrame f = new JFrame("Table with CheckBox");
    Container p = f.getContentPane();
    p.setLayout(new BorderLayout());
    table = new JTable(new Object[][] { { false }, { false }, { false } }, new Object[] { "CheckBox" });
    TableCellEditor editor = new TableCellEditor() {

        int editedRow;

        public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) {
            this.editedRow = row;
            editorCb.setSelected(Boolean.TRUE.equals(value));
            editorCb.setBackground(UIManager.getColor("Table.selectionBackground"));
            return editorCb;
        }

        public void addCellEditorListener(CellEditorListener l) {
        }

        public void cancelCellEditing() {
        }

        public Object getCellEditorValue() {
            return editorCb.isSelected();
        }

        public boolean isCellEditable(EventObject anEvent) {
            return true;
        }

        public void removeCellEditorListener(CellEditorListener l) {
        }

        public boolean shouldSelectCell(EventObject anEvent) {
            return true;
        }

        public boolean stopCellEditing() {
            table.getModel().setValueAt(editorCb.isSelected(), editedRow, 0);
            return true;
        }
    };
    table.getColumnModel().getColumn(0).setCellEditor(editor);
    TableCellRenderer renderer = new TableCellRenderer() {

        public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
            rendererCb.setSelected(Boolean.TRUE.equals(value));
            return rendererCb;
        }
    };
    table.getColumnModel().getColumn(0).setCellRenderer(renderer);
    p.add(table, BorderLayout.CENTER);
    f.pack();
    f.setVisible(true);
}
Also used : TableCellRenderer(javax.swing.table.TableCellRenderer) EventObject(java.util.EventObject) CellEditorListener(javax.swing.event.CellEditorListener) TableCellEditor(javax.swing.table.TableCellEditor) EventObject(java.util.EventObject)

Example 87 with TableCellEditor

use of javax.swing.table.TableCellEditor in project JMRI by JMRI.

the class EcosLocoTableAction method createModel.

@Override
protected void createModel() {
    m = new BeanTableDataModel() {

        //We have to set a manager first off, but this gets replaced.
        @Override
        protected EcosLocoAddressManager getManager() {
            return locoManager;
        }

        protected String getRosterAttribute() {
            return rosterAttribute;
        }

        @Override
        public String getValue(String s) {
            return "Set";
        }

        @Override
        protected String getMasterClassName() {
            return getClassName();
        }

        @Override
        public void clickOn(jmri.NamedBean t) {
        }

        @Override
        protected synchronized void updateNameList() {
            // first, remove listeners from the individual objects
            if (ecosObjectIdList != null) {
                for (int i = 0; i < ecosObjectIdList.size(); i++) {
                    // if object has been deleted, it's not here; ignore it
                    jmri.jmrix.ecos.EcosLocoAddress b = getByEcosObject(ecosObjectIdList.get(i));
                    if (b != null) {
                        b.removePropertyChangeListener(this);
                    }
                }
            }
            ecosObjectIdList = getManager().getEcosObjectList();
            // and add them back in
            for (int i = 0; i < ecosObjectIdList.size(); i++) {
                getByEcosObject(ecosObjectIdList.get(i)).addPropertyChangeListener(this);
            }
        }

        @Override
        public void propertyChange(java.beans.PropertyChangeEvent e) {
            updateNameList();
            if (e.getPropertyName().equals("length")) {
                // a new jmri.jmrix.ecos.EcosLocoAddressManager is available in the manager
                updateNameList();
                fireTableDataChanged();
            } else if (matchPropertyName(e)) {
                // a value changed.  Find it, to avoid complete redraw
                String object = ((jmri.jmrix.ecos.EcosLocoAddress) e.getSource()).getEcosObject();
                // since we can add columns, the entire row is marked as updated
                int row = ecosObjectIdList.indexOf(object);
                fireTableRowsUpdated(row, row);
            }
        }

        @Override
        public int getColumnCount() {
            return STOP + 1;
        }

        @Override
        public void setValueAt(Object value, int row, int col) {
            if (col == COMMENTCOL) {
                RosterEntry re;
                String ecosObjectNo = ecosObjectIdList.get(row);
                if (value == null) {
                    return;
                } else if (value instanceof RosterEntry) {
                    re = (RosterEntry) value;
                    if ((re.getAttribute(getRosterAttribute()) != null && !re.getAttribute(getRosterAttribute()).equals(""))) {
                        JOptionPane.showMessageDialog(f, ecosObjectNo + " This roster entry already has an ECOS loco assigned to it ");
                        log.error(ecosObjectNo + " This roster entry already has an ECOS loco assigned to it ");
                        return;
                    }
                    String oldRoster = getByEcosObject(ecosObjectNo).getRosterId();
                    RosterEntry oldre;
                    if (oldRoster != null) {
                        oldre = Roster.getDefault().getEntryForId(oldRoster);
                        if (oldre != null) {
                            oldre.deleteAttribute(getRosterAttribute());
                        }
                    }
                    re.putAttribute(getRosterAttribute(), ecosObjectNo);
                    getByEcosObject(ecosObjectNo).setRosterId(re.getId());
                    re.updateFile();
                } else if (value instanceof String) {
                    List<RosterEntry> r = Roster.getDefault().getEntriesWithAttributeKeyValue(getRosterAttribute(), ecosObjectNo);
                    if (r.isEmpty()) {
                        r.get(0).deleteAttribute(getRosterAttribute());
                        getByEcosObject(ecosObjectNo).setRosterId(null);
                        r.get(0).updateFile();
                    }
                }
                Roster.getDefault().writeRoster();
            } else if (col == ADDTOROSTERCOL) {
                addToRoster(row, col);
            } else if (col == STOP) {
                stopLoco(row, col);
            } else if (col == DELETECOL) {
                // button fired, delete Bean
                deleteLoco(row, col);
            } else if (col == USERNAMECOL) {
                jmri.jmrix.ecos.EcosLocoAddress b = getByEcosObject(ecosObjectIdList.get(row));
                EcosMessage m = new EcosMessage("request(" + b.getEcosObject() + ", control, force)");
                adaptermemo.getTrafficController().sendEcosMessage(m, null);
                m = new EcosMessage("set(" + b.getEcosObject() + ", name[\"" + (String) value + "\"])");
                adaptermemo.getTrafficController().sendEcosMessage(m, null);
                m = new EcosMessage("release(" + b.getEcosObject() + ", control)");
                adaptermemo.getTrafficController().sendEcosMessage(m, null);
            }
        }

        /**
             * {@inheritDoc }
             */
        @Override
        @Deprecated
        public JTable makeJTable(TableSorter sorter) {
            return this.makeJTable((TableModel) sorter);
        }

        @Override
        public JTable makeJTable(@Nonnull String name, @Nonnull TableModel model, @Nullable RowSorter sorter) {
            JTable table = this.makeJTable(model);
            table.setName(name);
            table.setRowSorter(sorter);
            return table;
        }

        private JTable makeJTable(@Nonnull TableModel model) {
            JTable table = new JTable(model) {

                @Override
                public TableCellRenderer getCellRenderer(int row, int column) {
                    if (column == COMMENTCOL) {
                        return getRenderer(row);
                    } else {
                        return super.getCellRenderer(row, column);
                    }
                }

                @Override
                public TableCellEditor getCellEditor(int row, int column) {
                    if (column == COMMENTCOL) {
                        return getEditor(row);
                    } else {
                        return super.getCellEditor(row, column);
                    }
                }

                TableCellRenderer getRenderer(int row) {
                    TableCellRenderer retval = rendererMap.get(ecosObjectIdList.get(row));
                    if (retval == null) {
                        jmri.jmrix.ecos.EcosLocoAddress b = getByEcosObject(ecosObjectIdList.get(row));
                        RosterEntry re = null;
                        if (b != null) {
                            re = Roster.getDefault().getEntryForId(b.getRosterId());
                        }
                        retval = new RosterBoxRenderer(re);
                        rendererMap.put(ecosObjectIdList.get(row), retval);
                    }
                    return retval;
                }

                Hashtable<Object, TableCellRenderer> rendererMap = new Hashtable<>();

                TableCellEditor getEditor(int row) {
                    TableCellEditor retval = editorMap.get(ecosObjectIdList.get(row));
                    if (retval == null) {
                        jmri.jmrix.ecos.EcosLocoAddress b = getByEcosObject(ecosObjectIdList.get(row));
                        RosterEntry re = null;
                        if (b != null) {
                            re = Roster.getDefault().getEntryForId(b.getRosterId());
                        }
                        GlobalRosterEntryComboBox cb = new GlobalRosterEntryComboBox();
                        cb.setNonSelectedItem(" ");
                        if (re == null) {
                            cb.setSelectedIndex(0);
                        } else {
                            cb.setSelectedItem(re);
                        }
                        // create a new one with right aspects
                        retval = new RosterComboBoxEditor(cb);
                        editorMap.put(ecosObjectIdList.get(row), retval);
                    }
                    return retval;
                }

                Hashtable<Object, TableCellEditor> editorMap = new Hashtable<>();
            };
            table.getTableHeader().setReorderingAllowed(true);
            table.setColumnModel(new XTableColumnModel());
            table.createDefaultColumnsFromModel();
            addMouseListenerToHeader(table);
            return table;
        }

        /**
             * Is this property event announcing a change this table should
             * display?
             * <P>
             * Note that events will come both from the
             * jmri.jmrix.ecos.EcosLocoAddressManagers and also from the manager
             */
        @Override
        protected boolean matchPropertyName(java.beans.PropertyChangeEvent e) {
            if (!showLocoMonitor && (e.getPropertyName().equals("Speed") || e.getPropertyName().equals("Direction"))) {
                return false;
            }
            return true;
        }

        @Override
        public String getColumnName(int col) {
            switch(col) {
                case SYSNAMECOL:
                    return "ECoS Object Id";
                case USERNAMECOL:
                    return "ECoS Descritpion";
                case VALUECOL:
                    return "ECoS Address";
                case COMMENTCOL:
                    return "JMRI Roster Id";
                case DELETECOL:
                    return "Delete";
                case PROTOCOL:
                    return "ECOS Protocol";
                case ADDTOROSTERCOL:
                    return "Add to Roster";
                case SPEEDDIR:
                    return "Speed Direction";
                case STOP:
                    return "Stop";
                default:
                    return "unknown";
            }
        }

        @Override
        public Class<?> getColumnClass(int col) {
            switch(col) {
                case SYSNAMECOL:
                case USERNAMECOL:
                case VALUECOL:
                case PROTOCOL:
                case SPEEDDIR:
                    return String.class;
                case ADDTOROSTERCOL:
                case DELETECOL:
                case STOP:
                    return JButton.class;
                case COMMENTCOL:
                    return JComboBox.class;
                default:
                    return null;
            }
        }

        @Override
        public boolean isCellEditable(int row, int col) {
            switch(col) {
                case COMMENTCOL:
                    return true;
                case ADDTOROSTERCOL:
                    jmri.jmrix.ecos.EcosLocoAddress b = getByEcosObject(ecosObjectIdList.get(row));
                    if (b.getRosterId() == null || b.getRosterId().equals("")) {
                        return true;
                    } else {
                        return false;
                    }
                case USERNAMECOL:
                case DELETECOL:
                case STOP:
                    return true;
                default:
                    return false;
            }
        }

        @Override
        public int getPreferredWidth(int col) {
            switch(col) {
                case SYSNAMECOL:
                    return new JTextField(5).getPreferredSize().width;
                case COMMENTCOL:
                    return new JTextField(20).getPreferredSize().width;
                case USERNAMECOL:
                    return new JTextField(20).getPreferredSize().width;
                case // not actually used due to the configureTable, setColumnToHoldButton, configureButton
                ADDTOROSTERCOL:
                    return new JTextField(12).getPreferredSize().width;
                case // not actually used due to the configureTable, setColumnToHoldButton, configureButton
                STOP:
                    return new JTextField(6).getPreferredSize().width;
                case VALUECOL:
                    return new JTextField(5).getPreferredSize().width;
                case SPEEDDIR:
                    return new JTextField(10).getPreferredSize().width;
                case PROTOCOL:
                    return new JTextField(5).getPreferredSize().width;
                default:
                    //log.warn("Unexpected column in getPreferredWidth: "+col);
                    return super.getPreferredWidth(col);
            }
        }

        @Override
        public void configureTable(JTable tbl) {
            table = tbl;
            setColumnToHoldButton(table, ADDTOROSTERCOL, new JButton("Add to Roster"));
            setColumnToHoldButton(table, STOP, stopButton());
            super.configureTable(table);
            XTableColumnModel columnModel = (XTableColumnModel) table.getColumnModel();
            TableColumn column = columnModel.getColumnByModelIndex(SPEEDDIR);
            columnModel.setColumnVisible(column, false);
            column = columnModel.getColumnByModelIndex(STOP);
            columnModel.setColumnVisible(column, false);
        }

        @Override
        public NamedBean getBySystemName(String name) {
            return null;
        }

        @Override
        public NamedBean getByUserName(String name) {
            return null;
        }

        @Override
        public synchronized void dispose() {
            showLocoMonitor = false;
            getManager().removePropertyChangeListener(this);
            if (ecosObjectIdList != null) {
                for (int i = 0; i < ecosObjectIdList.size(); i++) {
                    jmri.jmrix.ecos.EcosLocoAddress b = getByEcosObject(ecosObjectIdList.get(i));
                    if (b != null) {
                        b.removePropertyChangeListener(this);
                    }
                }
            }
        }

        protected void deleteLoco(final int row, int col) {
            if (row >= ecosObjectIdList.size()) {
                log.debug("row is greater than list size");
                return;
            }
            jmri.jmrix.ecos.EcosLocoAddress b = getByEcosObject(ecosObjectIdList.get(row));
            final JDialog dialog = new JDialog();
            dialog.setTitle("Remove Loco From ECOS");
            dialog.setLocation(300, 200);
            dialog.setDefaultCloseOperation(javax.swing.JFrame.DISPOSE_ON_CLOSE);
            JPanel container = new JPanel();
            container.setLayout(new BoxLayout(container, BoxLayout.Y_AXIS));
            container.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
            JLabel question = new JLabel("Are you sure that you want to remove loco " + b.getEcosDescription() + " from the ECOS ?");
            question.setAlignmentX(Component.CENTER_ALIGNMENT);
            container.add(question);
            JButton yesButton = new JButton("Yes");
            JButton noButton = new JButton("No");
            JPanel button = new JPanel();
            button.setAlignmentX(Component.CENTER_ALIGNMENT);
            button.add(yesButton);
            button.add(noButton);
            container.add(button);
            noButton.addActionListener(new ActionListener() {

                @Override
                public void actionPerformed(ActionEvent e) {
                    dialog.dispose();
                }
            });
            yesButton.addActionListener(new ActionListener() {

                @Override
                public void actionPerformed(ActionEvent e) {
                    RemoveObjectFromEcos removeObjectFromEcos = new RemoveObjectFromEcos();
                    removeObjectFromEcos.removeObjectFromEcos(ecosObjectIdList.get(row), adaptermemo.getTrafficController());
                    dialog.dispose();
                }
            });
            container.setAlignmentX(Component.CENTER_ALIGNMENT);
            container.setAlignmentY(Component.CENTER_ALIGNMENT);
            dialog.getContentPane().add(container);
            dialog.pack();
            dialog.setModal(true);
            dialog.setVisible(true);
        }

        @Override
        public int getRowCount() {
            return ecosObjectIdList.size();
        }

        @Override
        public Object getValueAt(int row, int col) {
            if (row >= ecosObjectIdList.size()) {
                log.debug("row is greater than list size");
                return null;
            }
            jmri.jmrix.ecos.EcosLocoAddress b;
            switch(col) {
                case SYSNAMECOL:
                    return ecosObjectIdList.get(row);
                case // return user name
                USERNAMECOL:
                    // sometimes, the TableSorter invokes this on rows that no longer exist, so we check
                    b = getByEcosObject(ecosObjectIdList.get(row));
                    return (b != null) ? b.getEcosDescription() : null;
                case //
                VALUECOL:
                    b = getByEcosObject(ecosObjectIdList.get(row));
                    return (b != null) ? b.getNumber() : null;
                case COMMENTCOL:
                    b = getByEcosObject(ecosObjectIdList.get(row));
                    RosterEntry re = null;
                    if (b != null) {
                        re = Roster.getDefault().getEntryForId(b.getRosterId());
                    }
                    GlobalRosterEntryComboBox cb = (GlobalRosterEntryComboBox) table.getCellRenderer(row, col);
                    if (re == null) {
                        cb.setSelectedIndex(0);
                    } else {
                        cb.setSelectedItem(re);
                    }
                    return re;
                case PROTOCOL:
                    b = getByEcosObject(ecosObjectIdList.get(row));
                    return (b != null) ? b.getECOSProtocol() : null;
                case //
                ADDTOROSTERCOL:
                    b = getByEcosObject(ecosObjectIdList.get(row));
                    if (b.getRosterId() == null || b.getRosterId().equals("")) {
                        return "Add To Roster";
                    } else {
                        return " ";
                    }
                case STOP:
                    return "Stop";
                case SPEEDDIR:
                    b = getByEcosObject(ecosObjectIdList.get(row));
                    return (b != null) ? (b.getDirectionAsString() + " : " + b.getSpeed()) : null;
                case //
                DELETECOL:
                    return Bundle.getMessage("ButtonDelete");
                default:
                    //log.error("internal state inconsistent with table requst for "+row+" "+col);
                    return null;
            }
        }

        @Override
        protected String getBeanType() {
            return "Ecos Loco";
        }

        @Override
        protected void showPopup(MouseEvent e) {
        }
    };
}
Also used : TableSorter(jmri.util.com.sun.TableSorter) JPanel(javax.swing.JPanel) EcosMessage(jmri.jmrix.ecos.EcosMessage) NamedBean(jmri.NamedBean) ActionEvent(java.awt.event.ActionEvent) BoxLayout(javax.swing.BoxLayout) JButton(javax.swing.JButton) JTextField(javax.swing.JTextField) NamedBean(jmri.NamedBean) List(java.util.List) GlobalRosterEntryComboBox(jmri.jmrit.roster.swing.GlobalRosterEntryComboBox) TableCellEditor(javax.swing.table.TableCellEditor) TableCellRenderer(javax.swing.table.TableCellRenderer) RowSorter(javax.swing.RowSorter) TableRowSorter(javax.swing.table.TableRowSorter) MouseEvent(java.awt.event.MouseEvent) Hashtable(java.util.Hashtable) JLabel(javax.swing.JLabel) XTableColumnModel(jmri.util.swing.XTableColumnModel) TableColumn(javax.swing.table.TableColumn) EcosLocoAddressManager(jmri.jmrix.ecos.EcosLocoAddressManager) EcosLocoAddress(jmri.jmrix.ecos.EcosLocoAddress) ActionListener(java.awt.event.ActionListener) JTable(javax.swing.JTable) BeanTableDataModel(jmri.jmrit.beantable.BeanTableDataModel) RosterEntry(jmri.jmrit.roster.RosterEntry) TableModel(javax.swing.table.TableModel) JDialog(javax.swing.JDialog) RemoveObjectFromEcos(jmri.jmrix.ecos.utilities.RemoveObjectFromEcos)

Example 88 with TableCellEditor

use of javax.swing.table.TableCellEditor in project JMRI by JMRI.

the class NodeTablePane method initComponents.

/**
     * Initialize the window
     */
public void initComponents() {
    setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
    nodesModel = new NodesModel();
    JTable nodesTable = new JTable(nodesModel);
    // install a button renderer & editor
    ButtonRenderer buttonRenderer = new ButtonRenderer();
    nodesTable.setDefaultRenderer(JButton.class, buttonRenderer);
    TableCellEditor buttonEditor = new ButtonEditor(new JButton());
    nodesTable.setDefaultEditor(JButton.class, buttonEditor);
    TableRowSorter<NodesModel> sorter = new TableRowSorter<>(nodesModel);
    RowSorterUtil.setSortOrder(sorter, NodesModel.STATUSCOL, SortOrder.DESCENDING);
    nodesTable.setRowSorter(sorter);
    nodesTable.setRowSelectionAllowed(false);
    nodesTable.setPreferredScrollableViewportSize(new java.awt.Dimension(580, 80));
    JScrollPane scrollPane = new JScrollPane(nodesTable);
    add(scrollPane);
    // status info on bottom
    JPanel p = new JPanel() {

        @Override
        public Dimension getMaximumSize() {
            int height = getPreferredSize().height;
            int width = super.getMaximumSize().width;
            return new Dimension(width, height);
        }
    };
    p.setLayout(new BoxLayout(p, BoxLayout.X_AXIS));
    JButton b = new JButton(rb.getString("ButtonCheck"));
    b.setToolTipText(rb.getString("TipCheck"));
    b.addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent event) {
            startPoll();
        }
    });
    p.add(b);
    status = new JLabel("");
    p.add(status);
    p.add(Box.createHorizontalGlue());
    // renumber button
    b = new JButton(rb.getString("ButtonRenumber"));
    b.addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent event) {
            renumber();
        }
    });
    p.add(b);
    add(p);
    // start the search for nodes
    startPoll();
}
Also used : JScrollPane(javax.swing.JScrollPane) JPanel(javax.swing.JPanel) ButtonEditor(jmri.util.table.ButtonEditor) ActionEvent(java.awt.event.ActionEvent) BoxLayout(javax.swing.BoxLayout) JButton(javax.swing.JButton) JLabel(javax.swing.JLabel) Dimension(java.awt.Dimension) Dimension(java.awt.Dimension) ActionListener(java.awt.event.ActionListener) JTable(javax.swing.JTable) TableCellEditor(javax.swing.table.TableCellEditor) ButtonRenderer(jmri.util.table.ButtonRenderer) TableRowSorter(javax.swing.table.TableRowSorter)

Example 89 with TableCellEditor

use of javax.swing.table.TableCellEditor in project JMRI by JMRI.

the class StackMonDataModel method initTable.

void initTable(JTable stackTable, StackMonFrame stackFrame) {
    // Install the button handlers for the Delete Buttons
    TableColumnModel tcm = stackTable.getColumnModel();
    ButtonRenderer buttonRenderer = new ButtonRenderer();
    tcm.getColumn(DELCOLUMN).setCellRenderer(buttonRenderer);
    TableCellEditor buttonEditor = new ButtonEditor(new javax.swing.JButton());
    tcm.getColumn(DELCOLUMN).setCellEditor(buttonEditor);
    _stackFrame = stackFrame;
}
Also used : ButtonEditor(jmri.util.table.ButtonEditor) TableColumnModel(javax.swing.table.TableColumnModel) TableCellEditor(javax.swing.table.TableCellEditor) ButtonRenderer(jmri.util.table.ButtonRenderer)

Example 90 with TableCellEditor

use of javax.swing.table.TableCellEditor in project JMRI by JMRI.

the class SlotMonDataModel method setColumnToHoldButton.

void setColumnToHoldButton(JTable slotTable, int column) {
    TableColumnModel tcm = slotTable.getColumnModel();
    // install the button renderers & editors in this column
    ButtonRenderer buttonRenderer = new ButtonRenderer();
    tcm.getColumn(column).setCellRenderer(buttonRenderer);
    TableCellEditor buttonEditor = new ButtonEditor(new JButton());
    tcm.getColumn(column).setCellEditor(buttonEditor);
    // ensure the table rows, columns have enough room for buttons
    slotTable.setRowHeight(new JButton("  " + getValueAt(1, column)).getPreferredSize().height);
    slotTable.getColumnModel().getColumn(column).setPreferredWidth(new JButton("  " + getValueAt(1, column)).getPreferredSize().width);
}
Also used : ButtonEditor(jmri.util.table.ButtonEditor) JButton(javax.swing.JButton) TableColumnModel(javax.swing.table.TableColumnModel) TableCellEditor(javax.swing.table.TableCellEditor) ButtonRenderer(jmri.util.table.ButtonRenderer)

Aggregations

TableCellEditor (javax.swing.table.TableCellEditor)129 JButton (javax.swing.JButton)41 ButtonEditor (jmri.util.table.ButtonEditor)33 ButtonRenderer (jmri.util.table.ButtonRenderer)33 TableColumnModel (javax.swing.table.TableColumnModel)24 JTable (javax.swing.JTable)22 ActionEvent (java.awt.event.ActionEvent)21 TableCellRenderer (javax.swing.table.TableCellRenderer)21 TableColumn (javax.swing.table.TableColumn)20 JLabel (javax.swing.JLabel)16 JScrollPane (javax.swing.JScrollPane)16 ActionListener (java.awt.event.ActionListener)15 MouseEvent (java.awt.event.MouseEvent)13 JPanel (javax.swing.JPanel)13 Component (java.awt.Component)11 Dimension (java.awt.Dimension)11 EventObject (java.util.EventObject)10 TableModel (javax.swing.table.TableModel)10 JComponent (javax.swing.JComponent)9 JTextField (javax.swing.JTextField)9