Search in sources :

Example 6 with TableColumnModel

use of javax.swing.table.TableColumnModel in project pcgen by PCGen.

the class Initiative method removeColumn.

private void removeColumn(String name) {
    TableColumnModel colModel = combatantTable.getColumnModel();
    for (int i = 0; i < colModel.getColumnCount(); i++) {
        TableColumn col = colModel.getColumn(i);
        if (col.getHeaderValue().toString().equals(name)) {
            colModel.removeColumn(col);
        }
    }
    trackTable();
    initTable();
    columnList = getColumnOrder();
}
Also used : TableColumnModel(javax.swing.table.TableColumnModel) TableColumn(javax.swing.table.TableColumn)

Example 7 with TableColumnModel

use of javax.swing.table.TableColumnModel in project pcgen by PCGen.

the class Initiative method addTableListener.

private void addTableListener() {
    TableColumnModel colModel = combatantTable.getColumnModel();
    colModel.addColumnModelListener(new javax.swing.event.TableColumnModelListener() {

        @Override
        public void columnAdded(javax.swing.event.TableColumnModelEvent e) {
            colModAdded(e);
        }

        @Override
        public void columnMarginChanged(javax.swing.event.ChangeEvent e) {
            colModMarginChanged(e);
        }

        @Override
        public void columnMoved(javax.swing.event.TableColumnModelEvent e) {
            colModMoved(e);
        }

        @Override
        public void columnRemoved(javax.swing.event.TableColumnModelEvent e) {
            colModRemoved(e);
        }

        @Override
        public void columnSelectionChanged(javax.swing.event.ListSelectionEvent e) {
            colModSelectionChanged(e);
        }
    });
}
Also used : TableColumnModel(javax.swing.table.TableColumnModel) ListSelectionEvent(javax.swing.event.ListSelectionEvent)

Example 8 with TableColumnModel

use of javax.swing.table.TableColumnModel in project SE2017_4_tuna by SE-admin.

the class Frame3 method setTableCellRenderer.

private void setTableCellRenderer(JTable todoTable, TableCellRenderer renderer) {
    TableColumnModel columnModel = todoTable.getColumnModel();
    int columnCount = columnModel.getColumnCount();
    for (int i = 0; i < columnCount; i++) {
        TableColumn column = columnModel.getColumn(i);
        column.setCellRenderer(renderer);
    }
}
Also used : TableColumnModel(javax.swing.table.TableColumnModel) TableColumn(javax.swing.table.TableColumn)

Example 9 with TableColumnModel

use of javax.swing.table.TableColumnModel in project SE2017_4_tuna by SE-admin.

the class Frame4 method setTableCellRenderer.

private void setTableCellRenderer(JTable table, TableCellRenderer renderer) {
    TableColumnModel columnModel = table.getColumnModel();
    int columnCount = columnModel.getColumnCount();
    for (int i = 0; i < columnCount; i++) {
        TableColumn column = columnModel.getColumn(i);
        column.setCellRenderer(renderer);
    }
}
Also used : TableColumnModel(javax.swing.table.TableColumnModel) TableColumn(javax.swing.table.TableColumn)

Example 10 with TableColumnModel

use of javax.swing.table.TableColumnModel in project SE2017_4_tuna by SE-admin.

the class MainFrame method setTableCellRenderer.

private void setTableCellRenderer(JTable table, TableCellRenderer renderer) {
    TableColumnModel columnModel = table.getColumnModel();
    int columnCount = columnModel.getColumnCount();
    for (int i = 0; i < columnCount; i++) {
        TableColumn column = columnModel.getColumn(i);
        column.setCellRenderer(renderer);
    }
}
Also used : TableColumnModel(javax.swing.table.TableColumnModel) TableColumn(javax.swing.table.TableColumn)

Aggregations

TableColumnModel (javax.swing.table.TableColumnModel)168 TableColumn (javax.swing.table.TableColumn)66 JTable (javax.swing.JTable)34 JScrollPane (javax.swing.JScrollPane)31 JButton (javax.swing.JButton)30 BoxLayout (javax.swing.BoxLayout)24 TableCellEditor (javax.swing.table.TableCellEditor)23 ButtonEditor (jmri.util.table.ButtonEditor)23 ButtonRenderer (jmri.util.table.ButtonRenderer)23 JLabel (javax.swing.JLabel)22 JPanel (javax.swing.JPanel)22 ActionEvent (java.awt.event.ActionEvent)20 ActionListener (java.awt.event.ActionListener)16 FlowLayout (java.awt.FlowLayout)15 Border (javax.swing.border.Border)13 Iterator (java.util.Iterator)12 Set (java.util.Set)12 JTableHeader (javax.swing.table.JTableHeader)12 TableCellRenderer (javax.swing.table.TableCellRenderer)12 Container (java.awt.Container)10