|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.yasl.tables.YASLTableUtils
Utils class for standalone table methods.
Field Summary | |
static int |
DISPLAY_ALL_ROWS
|
Method Summary | |
static Dimension |
adjustPreferredColumnWidths(JTable table)
Adjusts preferred column widths so that columns widths will be just wide enough to accomodate the content and the heading. |
static Dimension |
adjustPreferredColumnWidths(JTable table,
int visibleRows,
int veticalScrollBarWidth,
boolean setScrollableViewport)
Adjusts preferred column widths so that columns widths will be just wide enough to accomodate the content and the heading. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int DISPLAY_ALL_ROWS
Method Detail |
public static Dimension adjustPreferredColumnWidths(JTable table)
IMPORTANT: Call this method after the table model has been set.
Code drawn from Swing Hacks, 2005.
table
- JTable
public static Dimension adjustPreferredColumnWidths(JTable table, int visibleRows, int veticalScrollBarWidth, boolean setScrollableViewport)
Caller can specify the number of visible rows. This will affect the preferred table height returned in the Dimension object. An average row height is calculated then multiplied by the number of visible rows. Passing the constant DISPLAY_ALL_ROWS will result in a preferred table height that includes all the rows.
If your table is likely to have a vertical scrollbar, the
table width needs to account for it. Call the following methods
on your JScrollPane instance to the get the scroll bar width.
getVerticalScrollBar().getMaximumSize().width
If true is passed for the setScrollableViewport argument, the
setPreferredScrollableViewportSize
method will be called on
the passed JTable instance.
IMPORTANT: Call this method after the table model has been set.
Code drawn from Swing Hacks, 2005.
table
- JTablevisibleRows
- intveticalScrollBarWidth
- intsetScrollableViewport
- boolean
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |