Class WebbTable

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, EventListener, Accessible, CellEditorListener, ListSelectionListener, RowSorterListener, TableColumnModelListener, TableModelListener, Scrollable
Direct Known Subclasses:
WebbLeaderboardTable

public class WebbTable extends JTable
A wrapper class for JTable that provides some useful methods for setting it up and manipulating it.
See Also:
  • Constructor Details

    • WebbTable

      public WebbTable(String[] columnNames, String[][] data)
      Creates a new table with the given column names and data.
      Parameters:
      columnNames - The column names.
      data - The data.
  • Method Details

    • setColWidth

      protected final void setColWidth(int col, int width)
      Sets the width of the given column.
      Parameters:
      col - The column.
      width - The width.
    • removeCellLines

      protected final void removeCellLines()
      Removes the grid lines from the table.
    • setFont

      public void setFont(Font font)
      Sets the font of the table and its header.
      Overrides:
      setFont in class JComponent
      Parameters:
      font - The font.
    • setAlternatingColors

      protected final void setAlternatingColors(Color c1, Color c2)
      Enables alternating colors for the table.
      Parameters:
      c1 - The first color.
      c2 - The second color.
    • setHeaderColor

      protected final void setHeaderColor(Color c)
      Sets the color of the table header.
      Parameters:
      c - The color.
    • setTableEditingAllowed

      protected final void setTableEditingAllowed(boolean b)
      Enables or disables editing of the table.
      Parameters:
      b - True to enable editing, false to disable.
    • isCellEditable

      public boolean isCellEditable(int row, int column)
      Overridden to disable editing if editing is not allowed.
      Overrides:
      isCellEditable in class JTable
    • isCellSelected

      public boolean isCellSelected(int row, int column)
      Overridden to disable editing if editing is not allowed.
      Overrides:
      isCellSelected in class JTable