| Constructor and Description |
|---|
JTables() |
| Modifier and Type | Method and Description |
|---|---|
static void |
addRowSelectionInterval(JTable table,
int rowIndex)
Add the given row index
rowIndex (from the model coordinate)
in the selection of the given table. |
static int |
computeTableColumnWidth(JTable table,
Font font,
int columnIndex,
String suffix) |
static void |
doSelectCell(JTable table,
int rowIndex,
int columnIndex) |
static boolean |
editCell(JTable table,
int row,
int colummn)
Used to edit a cell of a given table.
|
static void |
ensureColumnIndex(TableModel model,
int index) |
static void |
ensureRowIndex(TableModel model,
int rowIndex) |
static void |
fixTableColumnWidth(JTable table,
int columnIndex,
int width) |
static int |
getSelectedModelColumn(JTable table)
Return the selected column of the table in the model coordinate or
-1 if selection is empty. |
static int |
getSelectedModelRow(JTable table)
Return the selected row of the table in the model coordinate or
-1 if selection is empty. |
static int[] |
getSelectedModelRows(JTable table)
Return the selected rows of the table in the model coordinate or empty
array if selection is empty.
|
static void |
makeTableTabFocusable(JTable table)
Add
KeyListener to focus next editable cell on TAB key |
static TableCellRenderer |
newStringTableCellRenderer(DefaultTableCellRenderer renderer,
int length,
boolean tooltip) |
static void |
scrollToTableSelection(JTable table)
Add to a given table a selec tion model listener to always scroll to
current cell selection.
|
static void |
selectFirstCellOnFirstRowAndStopEditing(JTable table) |
static void |
selectFirstCellOnLastRow(JTable table) |
static void |
selectFirstCellOnRow(JTable table,
int row,
boolean stopEdit) |
static void |
setI18nTableHeaderRenderer(JTable table,
String... libelles) |
static void |
setSelectionInterval(JTable table,
int rowIndex)
Select the given row index
rowIndex (from the model coordinate)
in the selection of the given table. |
static void |
setTableColumnEditor(JTable table,
int columnIndex,
TableCellEditor editor) |
static void |
setTableColumnRenderer(JTable table,
int columnIndex,
TableCellRenderer editor) |
public static void selectFirstCellOnFirstRowAndStopEditing(JTable table)
public static void selectFirstCellOnLastRow(JTable table)
public static void selectFirstCellOnRow(JTable table, int row, boolean stopEdit)
public static void doSelectCell(JTable table, int rowIndex, int columnIndex)
public static void makeTableTabFocusable(JTable table)
KeyListener to focus next editable cell on TAB keytable - to add TAB KeyListenerpublic static boolean editCell(JTable table, int row, int colummn)
table - the table to editrow - row index of cell to editingcolummn - column index of cell to editingfalse if for any reason the cell cannot be edited,
or if the indices are invalidpublic static void ensureRowIndex(TableModel model, int rowIndex) throws ArrayIndexOutOfBoundsException
ArrayIndexOutOfBoundsExceptionpublic static void ensureColumnIndex(TableModel model, int index) throws ArrayIndexOutOfBoundsException
ArrayIndexOutOfBoundsExceptionpublic static void scrollToTableSelection(JTable table)
table - the tablepublic static void setI18nTableHeaderRenderer(JTable table, String... libelles)
public static int[] getSelectedModelRows(JTable table)
table - the table to seekpublic static int getSelectedModelRow(JTable table)
-1 if selection is empty.table - the table to seek-1 if selection is empty.public static int getSelectedModelColumn(JTable table)
-1 if selection is empty.table - the table to seek-1 if selection is empty.public static void setSelectionInterval(JTable table, int rowIndex)
rowIndex (from the model coordinate)
in the selection of the given table.table - the table where to set the selectionrowIndex - the row index in the model coordinate to set as selectionpublic static void addRowSelectionInterval(JTable table, int rowIndex)
rowIndex (from the model coordinate)
in the selection of the given table.table - the table where to set the selectionrowIndex - the row index in the model coordinate to add to selectionpublic static int computeTableColumnWidth(JTable table, Font font, int columnIndex, String suffix)
public static void fixTableColumnWidth(JTable table, int columnIndex, int width)
public static void setTableColumnEditor(JTable table, int columnIndex, TableCellEditor editor)
public static void setTableColumnRenderer(JTable table, int columnIndex, TableCellRenderer editor)
public static TableCellRenderer newStringTableCellRenderer(DefaultTableCellRenderer renderer, int length, boolean tooltip)
Copyright © 2008–2015 CodeLutin. All rights reserved.