Examples of TableCellEditor


Examples of javax.swing.table.TableCellEditor

    */
   protected void stopTableEditing()
   {
      if (table.isEditing())
      {
         TableCellEditor cellEditor = table.getCellEditor(
               table.getEditingRow(), table.getEditingColumn());
         cellEditor.stopCellEditing();
      }
   }
View Full Code Here

Examples of javax.swing.table.TableCellEditor

   {
      // If a table cell is being edited, we must cancel the editing before
      // deleting the row
      if (table.isEditing())
      {
         TableCellEditor cellEditor = table.getCellEditor(
               table.getEditingRow(), table.getEditingColumn());
         cellEditor.cancelCellEditing();
      }

      int rowSelected = table.getSelectedRow();

      if (rowSelected >= 0)
View Full Code Here

Examples of javax.swing.table.TableCellEditor

    {
        // If a table cell is being edited, we must cancel the editing before
        // deleting the row
        if (table.isEditing())
        {
            TableCellEditor cellEditor = table.getCellEditor(
                    table.getEditingRow(),
                    table.getEditingColumn());
            cellEditor.cancelCellEditing();
        }

        int rowSelected = table.getSelectedRow();
        if (rowSelected >= 0)
        {
View Full Code Here

Examples of javax.swing.table.TableCellEditor

     */
    protected void stopTableEditing()
    {
        if (table.isEditing())
        {
            TableCellEditor cellEditor =
                table.getCellEditor(
                    table.getEditingRow(),
                    table.getEditingColumn());
            cellEditor.stopCellEditing();
        }
    }
View Full Code Here

Examples of javax.swing.table.TableCellEditor

    {
        public void actionPerformed(ActionEvent e)
        {
            if (paramTable.isEditing())
            {
                TableCellEditor cellEditor =
                    paramTable.getCellEditor(
                        paramTable.getEditingRow(),
                        paramTable.getEditingColumn());
                cellEditor.stopCellEditing();
            }

            tableModel.addNewRow();
            tableModel.fireTableDataChanged();
View Full Code Here

Examples of javax.swing.table.TableCellEditor

        public void actionPerformed(ActionEvent e)
        {

            if (paramTable.isEditing())
            {
                TableCellEditor cellEditor =
                    paramTable.getCellEditor(
                        paramTable.getEditingRow(),
                        paramTable.getEditingColumn());
                cellEditor.stopCellEditing();
            }

            tableModel.addNewColumn(
                THREAD_COLUMNS + "_" + tableModel.getColumnCount(),
                String.class);
View Full Code Here

Examples of javax.swing.table.TableCellEditor

    {
        public void actionPerformed(ActionEvent e)
        {
            if (paramTable.isEditing())
            {
                TableCellEditor cellEditor =
                    paramTable.getCellEditor(
                        paramTable.getEditingRow(),
                        paramTable.getEditingColumn());
                cellEditor.cancelCellEditing();
            }

            int rowSelected = paramTable.getSelectedRow();
            if (rowSelected >= 0)
            {
View Full Code Here

Examples of javax.swing.table.TableCellEditor

    {
        public void actionPerformed(ActionEvent e)
        {
            if (paramTable.isEditing())
            {
                TableCellEditor cellEditor =
                    paramTable.getCellEditor(
                        paramTable.getEditingRow(),
                        paramTable.getEditingColumn());
                cellEditor.cancelCellEditing();
            }

            int colSelected = paramTable.getSelectedColumn();
            if (colSelected == 0 || colSelected == 1)
            {
View Full Code Here

Examples of javax.swing.table.TableCellEditor

            {
                // If a table cell is being edited, we must cancel the editing
                // before deleting the row.
                if (headerTable.isEditing())
                {
                    TableCellEditor cellEditor =
                        headerTable.getCellEditor(
                            headerTable.getEditingRow(),
                            headerTable.getEditingColumn());
                    cellEditor.cancelCellEditing();
                }

                int rowSelected = headerTable.getSelectedRow();

                if (rowSelected != -1)
                {
                    tableModel.removeRow(rowSelected);
                    tableModel.fireTableDataChanged();

                    // Disable the DELETE and SAVE buttons if no rows remaining
                    // after delete
                    if (tableModel.getRowCount() == 0)
                    {
                        deleteButton.setEnabled(false);
                        saveButton.setEnabled(false);
                    }

                    // Table still contains one or more rows, so highlight
                    // (select) the appropriate one.
                    else
                    {
                        int rowToSelect = rowSelected;

                        if (rowSelected >= tableModel.getRowCount())
                        {
                            rowToSelect = rowSelected - 1;
                        }

                        headerTable.setRowSelectionInterval(
                            rowToSelect,
                            rowToSelect);
                    }
                }
            }
        }
        else if (action.equals("Add"))
        {
            // If a table cell is being edited, we should accept the current
            // value and stop the editing before adding a new row.
            if (headerTable.isEditing())
            {
                TableCellEditor cellEditor =
                    headerTable.getCellEditor(
                        headerTable.getEditingRow(),
                        headerTable.getEditingColumn());
                cellEditor.stopCellEditing();
            }

            tableModel.addNewRow();
            tableModel.fireTableDataChanged();
View Full Code Here

Examples of javax.swing.table.TableCellEditor

     */
    protected void stopTableEditing()
    {
        if (table.isEditing())
        {
            TableCellEditor cellEditor =
                table.getCellEditor(
                    table.getEditingRow(),
                    table.getEditingColumn());
            cellEditor.stopCellEditing();
        }
    }
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.