Class ColumnIndexSpinner

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible

public class ColumnIndexSpinner extends JSpinner
A JSpinner which can select the index of a new column. Note this presents values to the user which displays 1-based column indices while its getColumnIndex and setColumnIndex values are 0-based. Note this means that the legal spinner values are those between 1 (the lowest non-special column) and columnCount+1. Thus this is not as it stands a class of very general usefulness.
See Also:
  • Constructor Details

    • ColumnIndexSpinner

      public ColumnIndexSpinner(TableColumnModel columnModel, boolean add1)
      Constructs a new spinner based on a given model. Setting add1 true makes sense if you're adding a new column, and false if you're editing an existing one.
      Parameters:
      columnModel - the column model which defines the range of legal values
      add1 - if true, the maximum can be one larger than the current size of the model
  • Method Details

    • getColumnIndex

      public int getColumnIndex()
      Returns the 0-based selected column index.
      Returns:
      selected index
    • setColumnIndex

      public void setColumnIndex(int index)
      Sets the 0-based selected column index.
      Parameters:
      index - new index - can be -1 to indicate after the last one