Examples of removeColumn()


Examples of javax.swing.table.DefaultTableColumnModel.removeColumn()

    TableColumn c2 = new TableColumn(2, 45);
    m1.addColumn(c0);
    m1.addColumn(c1);
    m1.addColumn(c2);

    m1.removeColumn(c1);
    harness.check(m1.getColumnCount(), 2);
    harness.check(c1.getPropertyChangeListeners().length, 0);
   
    // remove a column that isn't there
    TableColumn c3 = new TableColumn(3, 99);
View Full Code Here

Examples of javax.swing.table.DefaultTableColumnModel.removeColumn()

    harness.check(m1.getColumnCount(), 2);
    harness.check(c1.getPropertyChangeListeners().length, 0);
   
    // remove a column that isn't there
    TableColumn c3 = new TableColumn(3, 99);
    m1.removeColumn(c3);
    harness.check(m1.getColumnCount(), 2);

    // remove a null column
    m1.removeColumn(null);
    harness.check(m1.getColumnCount(), 2);
View Full Code Here

Examples of javax.swing.table.DefaultTableColumnModel.removeColumn()

    TableColumn c3 = new TableColumn(3, 99);
    m1.removeColumn(c3);
    harness.check(m1.getColumnCount(), 2);

    // remove a null column
    m1.removeColumn(null);
    harness.check(m1.getColumnCount(), 2);
    // check that removing a column sends the correct event
    MyListener listener = new MyListener();
    m1.addColumnModelListener(listener);
View Full Code Here

Examples of javax.swing.table.DefaultTableColumnModel.removeColumn()

    harness.check(m1.getColumnCount(), 2);
    // check that removing a column sends the correct event
    MyListener listener = new MyListener();
    m1.addColumnModelListener(listener);
    m1.removeColumn(c0);
    harness.check(listener.getEvent() != null);
    harness.check(listener.getEvent().getFromIndex(), 0);
    harness.check(listener.getEvent().getToIndex(), 0);
  }
View Full Code Here

Examples of javax.swing.table.TableColumnModel.removeColumn()

                public void actionPerformed(ActionEvent event) {
                                    for(int i=0; i<14; i++) {
                                      boolean visibility = Boolean.parseBoolean(col_set_table.getModel().getValueAt(i, 0).toString());
                                      String column_name = col_set_table.getModel().getValueAt(i, 1).toString();
                                      //cols.get(column_name).setVisible(visibility);
                                      if(visibility == false) column_model.removeColumn(cols.get(column_name));
                                      System.out.println("Column from set " + cols.get(column_name).getHeaderValue());
                                      System.out.println("<--->" + column_name + "<---->" + visibility);
                                    }
                }
              });
View Full Code Here

Examples of javax.swing.table.TableColumnModel.removeColumn()

  private static void removeFirstColumn(final JTable table) {
    execute(new GuiTask() {
      @Override
      protected void executeInEDT() {
        TableColumnModel columnModel = table.getColumnModel();
        columnModel.removeColumn(columnModel.getColumn(0));
      }
    });
  }

  private static class MyWindow extends TestWindow {
View Full Code Here

Examples of javax.swing.table.TableColumnModel.removeColumn()

            TableColumn column = columnModel.getColumn(i);

            if (
              !preferenceModel.isColumnVisible(
                  column.getHeaderValue().toString())) {
              columnModel.removeColumn(column);
            }
          }

          Set columnSet = new HashSet();
          Enumeration enumeration = columnModel.getColumns();
View Full Code Here

Examples of javax.swing.table.TableColumnModel.removeColumn()

    {
      // Remove any current columns
      final TableColumnModel cm = getColumnModel();
      while (cm.getColumnCount() > 0)
      {
        cm.removeColumn(cm.getColumn(0));
      }

      // Create new columns from the data model info
      for (int i = 0; i < m.getColumnCount(); i++)
      {
View Full Code Here

Examples of javax.swing.table.TableColumnModel.removeColumn()

            int viewPos = table.convertColumnIndexToView(col.modelIndex);
            if (shouldBeVisible && viewPos == -1) {
                addColumnToModel(columnModel, col.modelIndex);
            } else if (shouldBeVisible == false && viewPos != -1) {
                columnModel.removeColumn(columnModel.getColumn(viewPos));
            }
        }
    }

    public void saveColumnVisibility(Preferences prefs, TableColumnModel orig,
View Full Code Here

Examples of javax.swing.table.TableColumnModel.removeColumn()

            int viewPos = getColumnIndex(columnModel, id);
            if (COLUMN_ADDED.equals(pref) && viewPos == -1) {
                addColumnToModel(columnModel, column.getModelIndex());
            } else if (COLUMN_REMOVED.equals(pref) && viewPos != -1) {
                columnModel.removeColumn(columnModel.getColumn(viewPos));
            }
        }
    }

    private void addColumnToModel(TableColumnModel columnModel, int modelIndex) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.