Package javax.swing.event

Examples of javax.swing.event.TableColumnModelListener


        assertEquals(3, model.getSelectedColumnCount());
    }

    public void testAddRemoveGetTableColumnModelListener() throws Exception {
        assertEquals(0, model.getColumnModelListeners().length);
        TableColumnModelListener listener = new TestTableColumnModelListener();
        model.addColumnModelListener(listener);
        model.addColumnModelListener(new TestTableColumnModelListener());
        assertEquals(2, model.getColumnModelListeners().length);
        model.removeColumnModelListener(listener);
        assertEquals(1, model.getColumnModelListeners().length);
View Full Code Here


        assertEquals(3, model.getSelectedColumnCount());
    }

    public void testAddRemoveGetTableColumnModelListener() throws Exception {
        assertEquals(0, model.getColumnModelListeners().length);
        TableColumnModelListener listener = new TestTableColumnModelListener();
        model.addColumnModelListener(listener);
        model.addColumnModelListener(new TestTableColumnModelListener());
        assertEquals(2, model.getColumnModelListeners().length);
        model.removeColumnModelListener(listener);
        assertEquals(1, model.getColumnModelListeners().length);
View Full Code Here

     *
     * @return the <code>TableColumnModelListener</code> for use with the
     *         table's columnModel.
     */
    protected TableColumnModelListener createColumnModelListener() {
        return new TableColumnModelListener() {
            /** Tells listeners that a column was added to the model. */
            public void columnAdded(TableColumnModelEvent e) {
                // quickfix for #192
                if (!isVisibilityChange(e, true)) {
                    populatePopup();
View Full Code Here

    final JTable newTable = new JTable(null, newColumnNames);
    JTableHeader newTableHeader = newTable.getTableHeader();
    newTableHeader.setReorderingAllowed(false);
    newTableHeader.setResizingAllowed(true);
    final List<TableColumn> newColumns = Collections.list(newTable.getColumnModel().getColumns());
    table.getColumnModel().addColumnModelListener(new TableColumnModelListener() {
      public void columnAdded(TableColumnModelEvent e) {
      }

      public void columnMarginChanged(ChangeEvent e) {
        newColumns.get(0).setWidth(oldColumns.get(0).getWidth());
View Full Code Here

     *
     * @return the <code>TableColumnModelListener</code> for use with the
     *         table's columnModel.
     */
    protected TableColumnModelListener createColumnModelListener() {
        return new TableColumnModelListener() {
            /** Tells listeners that a column was added to the model. */
            public void columnAdded(TableColumnModelEvent e) {
              populatePopup();
            }

View Full Code Here

    JTableHeader header = table.getTableHeader();
    header.setReorderingAllowed(false);
   
    header.addMouseListener(new TableHeaderListener(table, rowHeaders));

    table.getColumnModel().addColumnModelListener(new TableColumnModelListener() {

      @Override
      public void columnAdded(TableColumnModelEvent e) {
        possiblySaveStateAfterDelay();
      }
View Full Code Here

      @Override
      public void ancestorRemoved(AncestorEvent event) {
      }
    });
   
    table.getTable().getColumnModel().addColumnModelListener(new TableColumnModelListener() {

      @Override
      public void columnAdded(TableColumnModelEvent e) {
      }
View Full Code Here

  }

  public Table(final TableModel model) {
    super(model);
    addMouseListener(new MyMouseListener());
    getColumnModel().addColumnModelListener(new TableColumnModelListener() {
      public void columnMarginChanged(ChangeEvent e) {
        if (cellEditor != null) {
          cellEditor.stopCellEditing();
        }
      }
View Full Code Here

                }
            }
        });

        if (isVariableRowHeight()) {
            table.getColumnModel().addColumnModelListener(new TableColumnModelListener() {
                @Override
                public void columnAdded(TableColumnModelEvent e) {

                }
View Full Code Here

TOP

Related Classes of javax.swing.event.TableColumnModelListener

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.