public class JTableHelper
extends java.lang.Object
Constructor and Description |
---|
JTableHelper(javax.swing.JTable jtable)
initializes the object
|
Modifier and Type | Method and Description |
---|---|
int |
calcColumnWidth(int col)
calcs the optimal column width of the given column
|
static int |
calcColumnWidth(javax.swing.JTable table,
int col)
Calculates the optimal width for the column of the given table.
|
int |
calcHeaderWidth(int col)
calcs the optimal header width of the given column
|
static int |
calcHeaderWidth(javax.swing.JTable table,
int col)
Calculates the optimal width for the header of the given table.
|
javax.swing.JTable |
getJTable()
returns the JTable
|
void |
scrollToVisible(int row,
int col)
Assumes table is contained in a JScrollPane.
|
static void |
scrollToVisible(javax.swing.JTable table,
int row,
int col)
Assumes table is contained in a JScrollPane.
|
void |
setOptimalColumnWidth()
sets the optimal column width for all columns
|
void |
setOptimalColumnWidth(int col)
sets the optimal column width for the given column
|
static void |
setOptimalColumnWidth(javax.swing.JTable jtable)
sets the optimal column width for alls column if the given table
|
static void |
setOptimalColumnWidth(javax.swing.JTable jtable,
int col)
sets the optimal column width for the given column
|
void |
setOptimalHeaderWidth()
sets the optimal header width for all columns
|
void |
setOptimalHeaderWidth(int col)
sets the optimal header width for the given column
|
static void |
setOptimalHeaderWidth(javax.swing.JTable jtable)
sets the optimal header width for alls column if the given table
|
static void |
setOptimalHeaderWidth(javax.swing.JTable jtable,
int col)
sets the optimal header width for the given column
|
public JTableHelper(javax.swing.JTable jtable)
public javax.swing.JTable getJTable()
public int calcColumnWidth(int col)
public static int calcColumnWidth(javax.swing.JTable table, int col)
table
- the table to calculate the column widthcol
- the column to calculate the widthspublic int calcHeaderWidth(int col)
public static int calcHeaderWidth(javax.swing.JTable table, int col)
table
- the table to calculate the column widthcol
- the column to calculate the widthspublic void setOptimalColumnWidth(int col)
public static void setOptimalColumnWidth(javax.swing.JTable jtable, int col)
public void setOptimalColumnWidth()
public static void setOptimalColumnWidth(javax.swing.JTable jtable)
public void setOptimalHeaderWidth(int col)
public static void setOptimalHeaderWidth(javax.swing.JTable jtable, int col)
public void setOptimalHeaderWidth()
public static void setOptimalHeaderWidth(javax.swing.JTable jtable)
public void scrollToVisible(int row, int col)
public static void scrollToVisible(javax.swing.JTable table, int row, int col)