public class JTables extends Object
| Modifier and Type | Method and Description |
|---|---|
static void |
adjustColumnWidths(JTable table,
int maxWidth)
Adjust the preferred widths of the columns of the given table
depending on the contents of the cells and headers.
|
static List<Integer> |
computeRowsWithEqualValue(JTable table,
int row,
int col)
Compute the indices of all rows of the given table where the
value in the given column is equal to the value in the given
row
|
static Set<Integer> |
convertRowIndicesToModel(JTable table,
Iterable<? extends Integer> viewRows)
Convert all of the given view row indices to model row indices
for the given table
|
static Set<Integer> |
convertRowIndicesToView(JTable table,
Iterable<? extends Integer> modelRows)
Convert all of the given model row indices to view row indices
for the given table
|
static void |
scrollToRow(JTable table,
int row)
Scroll the given table so that the specified row is visible.
|
static void |
setFont(JTable t,
double size)
Set a font for the given table and its header that is derived from
its current font, but has the given size
|
static void |
setSmallFont(JTable t)
Set a "small" font for the given table and its header
|
public static void adjustColumnWidths(JTable table, int maxWidth)
table - The table to adjustmaxWidth - The maximum width a column may havepublic static void scrollToRow(JTable table, int row)
table - The tablerow - The rowpublic static Set<Integer> convertRowIndicesToView(JTable table, Iterable<? extends Integer> modelRows)
table - The tablemodelRows - The model row indicespublic static Set<Integer> convertRowIndicesToModel(JTable table, Iterable<? extends Integer> viewRows)
table - The tableviewRows - The view row indicespublic static List<Integer> computeRowsWithEqualValue(JTable table, int row, int col)
table - The tablerow - The reference rowcol - The columnpublic static void setSmallFont(JTable t)
t - The tablepublic static void setFont(JTable t, double size)
t - The tablesize - The sizeCopyright © 2022. All rights reserved.