Class StringArrayTableModel

  • All Implemented Interfaces:
    java.io.Serializable, javax.swing.table.TableModel

    public class StringArrayTableModel
    extends javax.swing.table.AbstractTableModel
    Table model based on a 2D string array.
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.lang.String[] columnnames  
      protected boolean editable
      Flag if editable.
      protected java.lang.String[][] stringarray
      The string array
      • Fields inherited from class javax.swing.table.AbstractTableModel

        listenerList
    • Constructor Summary

      Constructors 
      Constructor Description
      StringArrayTableModel​(java.lang.String[][] stringarray)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int getColumnCount()
      Override
      java.lang.String getColumnName​(int column)
      Override
      int getRowCount()
      Override
      java.lang.Object getValueAt​(int rowindex, int columnindex)
      Override
      boolean isCellEditable​(int rowIndex, int columnIndex)
      Override
      void setColumnNames​(java.lang.String[] names)
      Sets the column names.
      void setEditable​(boolean editable)
      Sets if editable.
      • Methods inherited from class javax.swing.table.AbstractTableModel

        addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getColumnClass, getListeners, getTableModelListeners, removeTableModelListener, setValueAt
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • stringarray

        protected java.lang.String[][] stringarray
        The string array
      • columnnames

        protected java.lang.String[] columnnames
      • editable

        protected boolean editable
        Flag if editable.
    • Constructor Detail

      • StringArrayTableModel

        public StringArrayTableModel​(java.lang.String[][] stringarray)
    • Method Detail

      • setColumnNames

        public void setColumnNames​(java.lang.String[] names)
        Sets the column names.
        Parameters:
        names - The column names.
      • setEditable

        public void setEditable​(boolean editable)
        Sets if editable.
        Parameters:
        editable - True if editable.
      • getColumnName

        public java.lang.String getColumnName​(int column)
        Override
        Specified by:
        getColumnName in interface javax.swing.table.TableModel
        Overrides:
        getColumnName in class javax.swing.table.AbstractTableModel
      • isCellEditable

        public boolean isCellEditable​(int rowIndex,
                                      int columnIndex)
        Override
        Specified by:
        isCellEditable in interface javax.swing.table.TableModel
        Overrides:
        isCellEditable in class javax.swing.table.AbstractTableModel
      • getRowCount

        public int getRowCount()
        Override
      • getColumnCount

        public int getColumnCount()
        Override
      • getValueAt

        public java.lang.Object getValueAt​(int rowindex,
                                           int columnindex)
        Override