Class EnumCellRenderer

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, SwingConstants, TableCellRenderer

public class EnumCellRenderer extends StringCellRenderer
This class implements a TableCellRenderer that displays the localized name string for an Enum value.
Author:
Andrew Pavlin, KA2DDO
See Also:
  • Constructor Details

    • EnumCellRenderer

      public EnumCellRenderer()
      Create an EnumCellRenderer.
  • Method Details

    • getTableCellRendererComponent

      public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column)
      Returns the table cell renderer.

      During a printing operation, this method will be called with isSelected and hasFocus values of false to prevent selection and focus from appearing in the printed output. To do other customization based on whether or not the table is being printed, check the return value from JComponent.isPaintingForPrint().

      Specified by:
      getTableCellRendererComponent in interface TableCellRenderer
      Overrides:
      getTableCellRendererComponent in class StringCellRenderer
      Parameters:
      table - the JTable
      value - the value to assign to the cell at [row, column]
      isSelected - true if cell is selected
      hasFocus - true if cell has focus
      row - the row of the cell to render
      column - the column of the cell to render
      Returns:
      the default table cell renderer
      See Also: