JTable
Date: 2019-10-22

org.jmol.awtjs.swing

## Class JTable

- java.lang.Object
- - org.jmol.awtjs.swing.Component
  - - org.jmol.awtjs.swing.Container
    - - org.jmol.awtjs.swing.JComponent
      - - org.jmol.awtjs.swing.JTable

- All Implemented Interfaces:
    ColumnSelectionModel, ListSelectionModel

      public class JTable
      extends JComponent
      implements ListSelectionModel, ColumnSelectionModel

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `private javajs.util.BS` | `bsSelectedCells`
    `private javajs.util.BS` | `bsSelectedRows`
    `(package private) boolean` | `cellSelectionEnabled`
    `(package private) boolean` | `rowSelectionAllowed`
    `(package private) java.lang.Object` | `selectionListener`
    `private AbstractTableModel` | `tableModel`

    - ### Fields inherited from class org.jmol.awtjs.swing.JComponent

      `actionCommand, actionListener, autoScrolls`

    - ### Fields inherited from class org.jmol.awtjs.swing.Container

      `list`

    - ### Fields inherited from class org.jmol.awtjs.swing.Component

      `enabled, height, id, minHeight, minWidth, mouseListener, name, parent, renderHeight, renderWidth, text, width`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `JTable(AbstractTableModel tableModel)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addListSelectionListener(java.lang.Object listener)` It will be the function of the JavaScript on the page to do with selectionListener what is desired.
    `void` | `clearSelection()`
    `TableColumn` | `getColumn(int i)`
    `ColumnSelectionModel` | `getColumnModel()`
    `ListSelectionModel` | `getSelectionModel()`
    `void` | `setCellSelectionEnabled(boolean enabled)`
    `void` | `setPreferredScrollableViewportSize(Dimension dimension)`
    `void` | `setRowSelectionAllowed(boolean b)`
    `void` | `setRowSelectionInterval(int i, int j)`
    `java.lang.String` | `toHTML()`

    - ### Methods inherited from class org.jmol.awtjs.swing.JComponent

      `addActionListener, getActionCommand, setActionCommand, setAutoscrolls`

    - ### Methods inherited from class org.jmol.awtjs.swing.Container

      `add, addComponent, getComponent, getComponentCount, getComponents, getSubcomponentHeight, getSubcomponentWidth, insertComponent, remove, removeAll`

    - ### Methods inherited from class org.jmol.awtjs.swing.Component

      `addMouseListener, getCSSstyle, getHeight, getName, getParent, getText, getWidth, isEnabled, isVisible, newID, repaint, setBackground, setEnabled, setMinimumSize, setName, setParent, setPreferredSize, setText, setVisible`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### tableModel

          private AbstractTableModel tableModel

    - #### bsSelectedCells

          private javajs.util.BS bsSelectedCells

    - #### bsSelectedRows

          private javajs.util.BS bsSelectedRows

    - #### rowSelectionAllowed

          boolean rowSelectionAllowed

    - #### cellSelectionEnabled

          boolean cellSelectionEnabled

    - #### selectionListener

          java.lang.Object selectionListener

  - ### Constructor Detail

    - #### JTable

          public JTable(AbstractTableModel tableModel)

  - ### Method Detail

    - #### getSelectionModel

          public ListSelectionModel getSelectionModel()

      Specified by:
        `getSelectionModel` in interface `ColumnSelectionModel`

    - #### getColumnModel

          public ColumnSelectionModel getColumnModel()

    - #### setPreferredScrollableViewportSize

          public void setPreferredScrollableViewportSize(Dimension dimension)

    - #### clearSelection

          public void clearSelection()

    - #### setRowSelectionAllowed

          public void setRowSelectionAllowed(boolean b)

    - #### setRowSelectionInterval

          public void setRowSelectionInterval(int i,
                                              int j)

    - #### setCellSelectionEnabled

          public void setCellSelectionEnabled(boolean enabled)

    - #### addListSelectionListener

          public void addListSelectionListener(java.lang.Object listener)

      It will be the function of the JavaScript on the page to do with selectionListener what is desired.
      Specified by:
        `addListSelectionListener` in interface `ListSelectionModel`
      Parameters:
        `listener` -

    - #### getColumn

          public TableColumn getColumn(int i)

      Specified by:
        `getColumn` in interface `ColumnSelectionModel`

    - #### toHTML

          public java.lang.String toHTML()

      Specified by:
        `toHTML` in class `Component`