public class Table extends Container
BOTTOM, BRB_CENTER_OFFSET, BRB_CONSTANT_ASCENT, BRB_CONSTANT_DESCENT, BRB_OTHER, CENTER, LEFT, RIGHT, TOP
Constructor and Description |
---|
Table(TableModel model)
Create a table with a new model
|
Table(TableModel model,
boolean includeHeader)
Create a table with a new model
|
Modifier and Type | Method and Description |
---|---|
protected Component |
createCell(Object value,
int row,
int column,
boolean editable)
Creates a cell based on the given value
|
protected TableLayout.Constraint |
createCellConstraint(Object value,
int row,
int column)
Creates the table cell constraint for the given cell, this method can be overriden for
the purposes of modifying the table constraints.
|
void |
deinitialize()
Invoked to indicate that the component initialization is being reversed
since the component was detached from the container hierarchy.
|
int |
getCellAlignment()
Indicates the alignment of the cells see label alignment for details
|
int |
getCellColumn(Component cell)
Returns the column in which the given cell is placed
|
int |
getCellRow(Component cell)
Returns the row in which the given cell is placed
|
TableModel |
getModel()
Returns the model instance
|
int |
getSelectedColumn()
Returns the selected column in the table
|
int |
getSelectedRow()
Returns the selected row in the table
|
int |
getTitleAlignment()
Indicates the alignment of the title see label alignment for details
|
void |
initComponent()
Allows subclasses to bind functionality that relies on fully initialized and
"ready for action" component state
|
boolean |
isDrawBorder()
Indicates whether the table border should be drawn
|
boolean |
isIncludeHeader()
Indicates whether the table should render a table header as the first row
|
protected void |
paintGlass(Graphics g)
This method can be overriden by a component to draw on top of itself or its children
after the component or the children finished drawing in a similar way to the glass
pane but more refined per component
|
void |
setCellAlignment(int cellAlignment)
Indicates the alignment of the cells see label alignment for details
|
void |
setDrawBorder(boolean drawBorder)
Indicates whether the table border should be drawn
|
void |
setIncludeHeader(boolean includeHeader)
Indicates whether the table should render a table header as the first row
|
void |
setModel(TableModel model)
Replaces the underlying model
|
void |
setTitleAlignment(int titleAlignment)
Indicates the alignment of the title see label alignment for details
|
addComponent, addComponent, addComponent, addComponent, applyRTL, calcPreferredSize, contains, flushReplace, getComponentAt, getComponentAt, getComponentCount, getComponentIndex, getLayout, getLayoutHeight, getLayoutWidth, getScrollIncrement, invalidate, isScrollableX, isScrollableY, layoutContainer, paint, paramString, pointerHover, pointerPressed, refreshTheme, removeAll, removeComponent, replace, replaceAndWait, revalidate, scrollComponentToVisible, setCellRenderer, setLayout, setScrollable, setScrollableX, setScrollableY, setScrollIncrement, setShouldCalcPreferredSize, setShouldLayout
addFocusListener, animate, calcScrollSize, contains, deinitializeCustomStyle, dragInitiated, fireClicked, focusGained, focusLost, getAbsoluteX, getAbsoluteY, getBaseline, getBaselineResizeBehavior, getBorder, getBottomGap, getBounds, getClientProperty, getComponentForm, getDirtyRegion, getHeight, getLabelForComponent, getNextFocusDown, getNextFocusLeft, getNextFocusRight, getNextFocusUp, getParent, getPreferredH, getPreferredSize, getPreferredW, getScrollAnimationSpeed, getScrollDimension, getScrollX, getScrollY, getSelectCommandText, getSelectedStyle, getSideGap, getStyle, getUIID, getUnselectedStyle, getVisibleBounds, getWidth, getX, getY, handlesInput, hasFocus, initCustomStyle, isBorderPainted, isDragActivated, isEnabled, isFocusable, isFocusPainted, isInitialized, isRTL, isScrollable, isScrollVisible, isSelectableInteraction, isSmoothScrolling, isTactileTouch, isTactileTouch, isTensileDragEnabled, isVisible, keyPressed, keyReleased, keyRepeated, laidOut, longKeyPress, longPointerPress, paintBackground, paintBackgrounds, paintBorder, paintComponent, paintComponent, paintScrollbars, paintScrollbarX, paintScrollbarY, pointerDragged, pointerDragged, pointerHoverReleased, pointerPressed, pointerReleased, pointerReleased, putClientProperty, refreshTheme, removeFocusListener, repaint, repaint, requestFocus, scrollRectToVisible, scrollRectToVisible, setBorderPainted, setDirtyRegion, setEnabled, setFocus, setFocusable, setFocusPainted, setHandlesInput, setHeight, setInitialized, setIsScrollVisible, setLabelForComponent, setNextFocusDown, setNextFocusLeft, setNextFocusRight, setNextFocusUp, setPreferredH, setPreferredSize, setPreferredW, setRTL, setScrollAnimationSpeed, setScrollSize, setScrollX, setScrollY, setSelectCommandText, setSelectedStyle, setSize, setSmoothScrolling, setStyle, setTactileTouch, setTensileDragEnabled, setUIID, setUnselectedStyle, setUnSelectedStyle, setVisible, setWidth, setX, setY, styleChanged, toString
public Table(TableModel model)
model
- the model underlying this tablepublic Table(TableModel model, boolean includeHeader)
model
- the model underlying this tableincludeHeader
- Indicates whether the table should render a table header as the first rowpublic int getSelectedRow()
public int getSelectedColumn()
protected void paintGlass(Graphics g)
Container
paintGlass
in class Container
g
- the graphics contextprotected Component createCell(Object value, int row, int column, boolean editable)
value
- the new value objectrow
- row number, -1 for the header rowscolumn
- column numbereditable
- true if the cell is editablepublic void initComponent()
Component
initComponent
in class Component
public void deinitialize()
Component
deinitialize
in class Component
public void setModel(TableModel model)
model
- the new modelpublic TableModel getModel()
public boolean isDrawBorder()
public void setDrawBorder(boolean drawBorder)
drawBorder
- the drawBorder to setpublic int getTitleAlignment()
Label.setAlignment(int)
public void setTitleAlignment(int titleAlignment)
titleAlignment
- the title alignmentLabel.setAlignment(int)
public int getCellColumn(Component cell)
cell
- the component representing the cell placed in the tablepublic int getCellRow(Component cell)
cell
- the component representing the cell placed in the tablepublic int getCellAlignment()
Label.setAlignment(int)
public void setCellAlignment(int cellAlignment)
cellAlignment
- the table cell alignmentLabel.setAlignment(int)
public boolean isIncludeHeader()
public void setIncludeHeader(boolean includeHeader)
includeHeader
- the includeHeader to setprotected TableLayout.Constraint createCellConstraint(Object value, int row, int column)
value
- the value of the cellrow
- the table rowcolumn
- the table column