java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JTable
- All Implemented Interfaces:
- ImageObserver, MenuContainer, Serializable, EventListener, Accessible, CellEditorListener, ListSelectionListener, TableColumnModelListener, TableModelListener, Scrollable
- See Also:
- Top Examples, Source Code,
XMLEncoder
, KeyStroke
, ActionMap
, InputMap
, getPrintable(javax.swing.JTable.PrintMode, java.text.MessageFormat, java.text.MessageFormat)
, print()
, getTableHeader()
public void addColumn(TableColumn aColumn)
- See Also:
removeColumn(javax.swing.table.TableColumn)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
[428]Advanced Table Example
By Anonymous on 2005/06/16 23:49:24 Rate
import java.awt.*;
import java.util.*;
import javax.swing.*;
import javax.swing.table.*;
class AdvancedTableExample extends JFrame
{
// Instance attributes used in this example
private JPanel topPanel;
private JTable table;
private JScrollPane scrollPane;
private String columnNames [ ] ;
private String dataValues [ ] [ ] ;
// Constructor of main frame
public AdvancedTableExample ( )
{
// Set the frame characteristics
setTitle ( "Advanced Table Application" ) ;
setSize ( 300, 200 ) ;
setBackground ( Color.gray ) ;
// Create a panel to hold all other components
topPanel = new JPanel ( ) ;
topPanel.setLayout ( new BorderLayout ( ) ) ;
getContentPane ( ) .add ( topPanel ) ;
// Create columns
CreateColumns ( ) ;
CreateData ( ) ;
// Create a new table instance
table = new JTable ( dataValues, columnNames ) ;
// Configure some of JTable's paramters
table.setShowHorizontalLines ( false ) ;
table.setRowSelectionAllowed ( true ) ;
table.setColumnSelectionAllowed ( true ) ;
// Change the selection colour
table.setSelectionForeground ( Color.white ) ;
table.setSelectionBackground ( Color.red ) ;
// Add the table to a scrolling pane
scrollPane = table.createScrollPaneForTable ( table ) ;
topPanel.add ( scrollPane, BorderLayout.CENTER ) ;
}
public void CreateColumns ( )
{
// Create column string labels
columnNames = new String [ 8 ] ;
for ( int iCtr = 0; iCtr < 8; iCtr++ )
columnNames [ iCtr ] = "Col:" + iCtr;
}
public void CreateData ( )
{
// Create data for each element
dataValues = new String [ 100 ] [ 8 ] ;
for ( int iY = 0; iY < 100; iY++ )
{
for ( int iX = 0; iX < 8; iX++ )
{
dataValues [ iY ] [ iX ] = "" + iX + "," + iY;
}
}
}
// Main entry point for this example
public static void main ( String args [ ] )
{
// Create an instance of the test application
AdvancedTableExample mainFrame = new AdvancedTableExample ( ) ;
mainFrame.setVisible ( true ) ;
}
}
//addColumn
public void addColumnSelectionInterval(int index0,
int index1)
- See Also:
- IllegalArgumentException
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public void addNotify()
- See Also:
configureEnclosingScrollPane()
, JComponent
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public void addRowSelectionInterval(int index0,
int index1)
- See Also:
- IllegalArgumentException
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
protected boolean autoCreateColumnsFromModel
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
protected int autoResizeMode
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public static final int AUTO_RESIZE_ALL_COLUMNS
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public static final int AUTO_RESIZE_LAST_COLUMN
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public static final int AUTO_RESIZE_NEXT_COLUMN
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public static final int AUTO_RESIZE_OFF
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public static final int AUTO_RESIZE_SUBSEQUENT_COLUMNS
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
protected transient TableCellEditor cellEditor
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
protected boolean cellSelectionEnabled
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public void changeSelection(int rowIndex,
int columnIndex,
boolean toggle,
boolean extend)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public void clearSelection()
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public void columnAdded(TableColumnModelEvent e)
- See Also:
TableColumnModelListener
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public int columnAtPoint(Point point)
- See Also:
rowAtPoint(java.awt.Point)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public void columnMarginChanged(ChangeEvent e)
- See Also:
TableColumnModelListener
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
protected TableColumnModel columnModel
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public void columnMoved(TableColumnModelEvent e)
- See Also:
TableColumnModelListener
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public void columnRemoved(TableColumnModelEvent e)
- See Also:
TableColumnModelListener
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public void columnSelectionChanged(ListSelectionEvent e)
- See Also:
TableColumnModelListener
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
protected void configureEnclosingScrollPane()
- See Also:
addNotify()
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public int convertColumnIndexToModel(int viewColumnIndex)
- See Also:
convertColumnIndexToView(int)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public int convertColumnIndexToView(int modelColumnIndex)
- See Also:
convertColumnIndexToModel(int)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
protected TableColumnModel createDefaultColumnModel()
- See Also:
DefaultTableColumnModel
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public void createDefaultColumnsFromModel()
- See Also:
getAutoCreateColumnsFromModel()
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
protected TableModel createDefaultDataModel()
- See Also:
DefaultTableModel
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
protected void createDefaultEditors()
- See Also:
DefaultCellEditor
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
protected void createDefaultRenderers()
- See Also:
DefaultTableCellRenderer
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
protected ListSelectionModel createDefaultSelectionModel()
- See Also:
DefaultListSelectionModel
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
protected JTableHeader createDefaultTableHeader()
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
@Deprecated
public static JScrollPane createScrollPaneForTable(JTable aTable)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
protected TableModel dataModel
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
protected transient Hashtable defaultEditorsByColumnClass
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
protected transient Hashtable defaultRenderersByColumnClass
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public void doLayout()
- See Also:
Container.validate()
, Container.setLayout(java.awt.LayoutManager)
, LayoutManager.layoutContainer(java.awt.Container)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public boolean editCellAt(int row,
int column)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public boolean editCellAt(int row,
int column,
EventObject e)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
[682]Editing a cell
By Kai Middleton on 2004/03/05 14:46:38 Rate
// For editing a cell,
// the JTable class uses a component
// that implements the TableCellEditor interface.
// This component lies on top of the edited cell
// during the editing process.
// The JTable class also provides an
// editCellAt ( int row, int col, EventObject e ) method
// that is called when the user double-clicks a cell
// to start the editing.
// The default implementation of this method first checks
// that the cell is editable by calling isCellEditable ( )
// on the model component.
// Then it calls the prepareEditor ( ) method
// that in turn reads the content to be displayed
// by calling the JTable getValueAt ( int row, int col ) method,
// and it sets this content to be the default value
// displayed by the editing component.
[686]Add a row to a table
By Kai Middleton on 2005/06/30 07:03:55 Rate
public void actionPerformed ( ActionEvent e )
{
if ( e.getSource ( ) == addButton )
{
model.addRow ( "" ) ;
table.scrollRectToVisible ( table.getCellRect ( listItems.size ( ) -1, 0, true ) ) ;
if ( table.editCellAt ( listItems.size ( ) -1, 0 ) )
table.getEditorComponent ( ) .requestFocus ( ) ;
}
}
public void editingCanceled(ChangeEvent e)
- See Also:
CellEditorListener
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
protected transient int editingColumn
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
protected transient int editingRow
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public void editingStopped(ChangeEvent e)
- See Also:
CellEditorListener
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
protected transient Component editorComp
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public AccessibleContext getAccessibleContext()
- See Also:
- JComponent, Accessible
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public boolean getAutoCreateColumnsFromModel()
- See Also:
createDefaultColumnsFromModel()
, setAutoCreateColumnsFromModel(boolean)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public int getAutoResizeMode()
- See Also:
doLayout()
, setAutoResizeMode(int)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public TableCellEditor getCellEditor()
- See Also:
cellEditor
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public TableCellEditor getCellEditor(int row,
int column)
- See Also:
DefaultCellEditor
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public Rectangle getCellRect(int row,
int column,
boolean includeSpacing)
- See Also:
convertColumnIndexToView(int)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public TableCellRenderer getCellRenderer(int row,
int column)
- See Also:
setDefaultRenderer(java.lang.Class>, javax.swing.table.TableCellRenderer)
, TableColumn.setCellRenderer(javax.swing.table.TableCellRenderer)
, DefaultTableCellRenderer
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public boolean getCellSelectionEnabled()
- See Also:
setCellSelectionEnabled(boolean)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public TableColumn getColumn(Object identifier)
- See Also:
- IllegalArgumentException
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public Class<?> getColumnClass(int column)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public int getColumnCount()
- See Also:
removeColumn(javax.swing.table.TableColumn)
, getRowCount()
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public TableColumnModel getColumnModel()
- See Also:
setColumnModel(javax.swing.table.TableColumnModel)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public String getColumnName(int column)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public boolean getColumnSelectionAllowed()
- See Also:
setColumnSelectionAllowed(boolean)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public TableCellEditor getDefaultEditor(Class<?> columnClass)
- See Also:
getColumnClass(int)
, setDefaultEditor(java.lang.Class>, javax.swing.table.TableCellEditor)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public TableCellRenderer getDefaultRenderer(Class<?> columnClass)
- See Also:
getColumnClass(int)
, setDefaultRenderer(java.lang.Class>, javax.swing.table.TableCellRenderer)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public boolean getDragEnabled()
- See Also:
setDragEnabled(boolean)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public int getEditingColumn()
- See Also:
editingRow
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public int getEditingRow()
- See Also:
editingColumn
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public Component getEditorComponent()
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public Color getGridColor()
- See Also:
setGridColor(java.awt.Color)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public Dimension getIntercellSpacing()
- See Also:
setIntercellSpacing(java.awt.Dimension)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public TableModel getModel()
- See Also:
setModel(javax.swing.table.TableModel)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public Dimension getPreferredScrollableViewportSize()
- See Also:
- Scrollable
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public Printable getPrintable(JTable.PrintMode printMode,
MessageFormat headerFormat,
MessageFormat footerFormat)
- See Also:
PrinterJob
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public int getRowCount()
- See Also:
getColumnCount()
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public int getRowHeight()
- See Also:
setRowHeight(int)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public int getRowHeight(int row)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public int getRowMargin()
- See Also:
setRowMargin(int)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public boolean getRowSelectionAllowed()
- See Also:
setRowSelectionAllowed(boolean)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public int getScrollableBlockIncrement(Rectangle visibleRect,
int orientation,
int direction)
- See Also:
- Scrollable
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public boolean getScrollableTracksViewportHeight()
- See Also:
- Scrollable
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public boolean getScrollableTracksViewportWidth()
- See Also:
- Scrollable
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public int getScrollableUnitIncrement(Rectangle visibleRect,
int orientation,
int direction)
- See Also:
- Scrollable
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public int getSelectedColumn()
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public int getSelectedColumnCount()
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public int[] getSelectedColumns()
- See Also:
getSelectedColumn()
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public int getSelectedRow()
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public int getSelectedRowCount()
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public int[] getSelectedRows()
- See Also:
getSelectedRow()
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
[687]Delete a row from a table
By Kai Middleton on 2004/03/08 02:04:29 Rate
public void actionPerformed ( ActionEvent e )
{
if ( e.getSource ( ) == deleteButton )
{
int [ ] rowIndices = table.getSelectedRows ( ) ;
for ( int i=rowIndices.length-1; i > =0; i-- )
System.out.print ( rowIndices [ i ] + " " ) ;
model.deleteRows ( rowIndices ) ;
}
}
public Color getSelectionBackground()
- See Also:
setSelectionForeground(java.awt.Color)
, setSelectionBackground(java.awt.Color)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public Color getSelectionForeground()
- See Also:
setSelectionBackground(java.awt.Color)
, setSelectionForeground(java.awt.Color)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public ListSelectionModel getSelectionModel()
- See Also:
setSelectionModel(javax.swing.ListSelectionModel)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public boolean getShowHorizontalLines()
- See Also:
setShowHorizontalLines(boolean)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public boolean getShowVerticalLines()
- See Also:
setShowVerticalLines(boolean)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public boolean getSurrendersFocusOnKeystroke()
- See Also:
setSurrendersFocusOnKeystroke(boolean)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public JTableHeader getTableHeader()
- See Also:
setTableHeader(javax.swing.table.JTableHeader)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public String getToolTipText(MouseEvent event)
- See Also:
JComponent.getToolTipText()
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public TableUI getUI()
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public String getUIClassID()
- See Also:
UIDefaults.getUI(javax.swing.JComponent)
, JComponent
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public Object getValueAt(int row,
int column)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
protected Color gridColor
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
protected void initializeLocalVars()
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public boolean isCellEditable(int row,
int column)
- See Also:
setValueAt(java.lang.Object, int, int)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public boolean isCellSelected(int row,
int column)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public boolean isColumnSelected(int column)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public boolean isEditing()
- See Also:
editingRow
, editingColumn
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public boolean isRowSelected(int row)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public JTable()
- See Also:
createDefaultSelectionModel()
, createDefaultColumnModel()
, createDefaultDataModel()
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public JTable(int numRows,
int numColumns)
- See Also:
DefaultTableModel
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public JTable(Object[][] rowData,
Object[] columnNames)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public JTable(Vector rowData,
Vector columnNames)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
[47]Create table with data
By Anonymous on 2004/06/16 20:33:55 Rate
// Create columns names
String columnNames [ ] = { "Column 1", "Column 2", "Column 3" } ;
// Create some data
String dataValues [ ] [ ] =
{
{ "12", "234", "67" } ,
{ "-123", "43", "853" } ,
{ "93", "89.2", "109" } ,
{ "279", "9033", "3092" }
} ;
// Create a new table instance
table = new JTable ( dataValues, columnNames ) ;
// Add the table to a scrolling pane
JScrollPane scrollPane = new JScrollPane ( table ) ;
getContentPane ( ) .add ( scrollPane, BorderLayout.CENTER ) ;
public JTable(TableModel dm)
- See Also:
createDefaultSelectionModel()
, createDefaultColumnModel()
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public JTable(TableModel dm,
TableColumnModel cm)
- See Also:
createDefaultSelectionModel()
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public JTable(TableModel dm,
TableColumnModel cm,
ListSelectionModel sm)
- See Also:
createDefaultSelectionModel()
, createDefaultColumnModel()
, createDefaultDataModel()
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public void moveColumn(int column,
int targetColumn)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
protected String paramString()
- See Also:
- JComponent
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
protected Dimension preferredViewportSize
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public Component prepareEditor(TableCellEditor editor,
int row,
int column)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public Component prepareRenderer(TableCellRenderer renderer,
int row,
int column)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public boolean print()
throws PrinterException
- See Also:
getPrintable(javax.swing.JTable.PrintMode, java.text.MessageFormat, java.text.MessageFormat)
, print(JTable.PrintMode, MessageFormat, MessageFormat,
boolean, PrintRequestAttributeSet, boolean)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public boolean print(JTable.PrintMode printMode)
throws PrinterException
- See Also:
getPrintable(javax.swing.JTable.PrintMode, java.text.MessageFormat, java.text.MessageFormat)
, print(JTable.PrintMode, MessageFormat, MessageFormat,
boolean, PrintRequestAttributeSet, boolean)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public boolean print(JTable.PrintMode printMode,
MessageFormat headerFormat,
MessageFormat footerFormat)
throws PrinterException
- See Also:
getPrintable(javax.swing.JTable.PrintMode, java.text.MessageFormat, java.text.MessageFormat)
, print(JTable.PrintMode, MessageFormat, MessageFormat,
boolean, PrintRequestAttributeSet, boolean)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public boolean print(JTable.PrintMode printMode,
MessageFormat headerFormat,
MessageFormat footerFormat,
boolean showPrintDialog,
PrintRequestAttributeSet attr,
boolean interactive)
throws PrinterException,
HeadlessException
- See Also:
GraphicsEnvironment.isHeadless()
, getPrintable(javax.swing.JTable.PrintMode, java.text.MessageFormat, java.text.MessageFormat)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
protected boolean processKeyBinding(KeyStroke ks,
KeyEvent e,
int condition,
boolean pressed)
- See Also:
- JComponent
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
[650]Check to see if Alt is pressed
By rose_resume { at } yahoo { dot } com on 2004/11/17 17:21:27 Rate
protected boolean processKeyBinding ( javax.swing.KeyStroke ks,KeyEvent e, int condition, boolean pressed )
{
System.out.println ( "" ) ;
System.out.println ( " I am here ===== > 1" ) ;
System.out.println ( "" ) ;
System.out.println ( e.getKeyChar ( ) ) ;
if ( e.isAltDown ( ) )
{
System.out.println ( "Not passing on ks="+ ks ) ;
return false;
}
return true;
super.processKeyBinding ( ks, e, condition, pressed ) ;
}
public void removeColumn(TableColumn aColumn)
- See Also:
addColumn(javax.swing.table.TableColumn)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public void removeColumnSelectionInterval(int index0,
int index1)
- See Also:
- IllegalArgumentException
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public void removeEditor()
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public void removeNotify()
- See Also:
unconfigureEnclosingScrollPane()
, JComponent
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public void removeRowSelectionInterval(int index0,
int index1)
- See Also:
- IllegalArgumentException
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
protected void resizeAndRepaint()
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public int rowAtPoint(Point point)
- See Also:
columnAtPoint(java.awt.Point)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
protected int rowHeight
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
protected int rowMargin
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
protected boolean rowSelectionAllowed
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public void selectAll()
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
protected Color selectionBackground
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
protected Color selectionForeground
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
protected ListSelectionModel selectionModel
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public void setAutoCreateColumnsFromModel(boolean autoCreateColumnsFromModel)
- See Also:
createDefaultColumnsFromModel()
, getAutoCreateColumnsFromModel()
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public void setAutoResizeMode(int mode)
- See Also:
doLayout()
, getAutoResizeMode()
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public void setCellEditor(TableCellEditor anEditor)
- See Also:
cellEditor
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public void setCellSelectionEnabled(boolean cellSelectionEnabled)
- See Also:
isCellSelected(int, int)
, getCellSelectionEnabled()
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public void setColumnModel(TableColumnModel columnModel)
- See Also:
getColumnModel()
, IllegalArgumentException
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public void setColumnSelectionAllowed(boolean columnSelectionAllowed)
- See Also:
getColumnSelectionAllowed()
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public void setColumnSelectionInterval(int index0,
int index1)
- See Also:
- IllegalArgumentException
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public void setDefaultEditor(Class<?> columnClass,
TableCellEditor editor)
- See Also:
setDefaultRenderer(java.lang.Class>, javax.swing.table.TableCellRenderer)
, getDefaultEditor(java.lang.Class>)
, TableModel.isCellEditable(int, int)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public void setDefaultRenderer(Class<?> columnClass,
TableCellRenderer renderer)
- See Also:
setDefaultEditor(java.lang.Class>, javax.swing.table.TableCellEditor)
, getDefaultRenderer(java.lang.Class>)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
[1552]JProgressBar in a JTable
By Paul Andrew Smith on 2005/10/04 02:50:12 Rate
// JProgressBar ( ) 's in a JTable ( )
table.setDefaultRenderer ( JProgressBar.class,
new progressBarRenderer ( ) ) ;
private class progressBarRenderer implements TableCellRenderer {
public Component getTableCellRendererComponent ( JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column ) {
return ( JProgressBar ) value;
}
}
public void setDragEnabled(boolean b)
- See Also:
TransferHandler
, JComponent.setTransferHandler(javax.swing.TransferHandler)
, getDragEnabled()
, GraphicsEnvironment.isHeadless()
, HeadlessException
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public void setEditingColumn(int aColumn)
- See Also:
editingColumn
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public void setEditingRow(int aRow)
- See Also:
editingRow
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public void setGridColor(Color gridColor)
- See Also:
getGridColor()
, IllegalArgumentException
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public void setIntercellSpacing(Dimension intercellSpacing)
- See Also:
getIntercellSpacing()
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public void setModel(TableModel dataModel)
- See Also:
getModel()
, IllegalArgumentException
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public void setPreferredScrollableViewportSize(Dimension size)
- See Also:
Scrollable.getPreferredScrollableViewportSize()
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public void setRowHeight(int rowHeight)
- See Also:
getRowHeight()
, IllegalArgumentException
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public void setRowHeight(int row,
int rowHeight)
- See Also:
- IllegalArgumentException
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public void setRowMargin(int rowMargin)
- See Also:
getRowMargin()
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public void setRowSelectionAllowed(boolean rowSelectionAllowed)
- See Also:
getRowSelectionAllowed()
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public void setRowSelectionInterval(int index0,
int index1)
- See Also:
- IllegalArgumentException
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public void setSelectionBackground(Color selectionBackground)
- See Also:
JComponent.setFont(java.awt.Font)
, JComponent.setBackground(java.awt.Color)
, JComponent.setForeground(java.awt.Color)
, setSelectionForeground(java.awt.Color)
, getSelectionBackground()
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public void setSelectionForeground(Color selectionForeground)
- See Also:
JComponent.setFont(java.awt.Font)
, JComponent.setBackground(java.awt.Color)
, JComponent.setForeground(java.awt.Color)
, setSelectionBackground(java.awt.Color)
, getSelectionForeground()
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public void setSelectionMode(int selectionMode)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public void setSelectionModel(ListSelectionModel newModel)
- See Also:
getSelectionModel()
, IllegalArgumentException
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public void setShowGrid(boolean showGrid)
- See Also:
setShowHorizontalLines(boolean)
, setShowVerticalLines(boolean)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public void setShowHorizontalLines(boolean showHorizontalLines)
- See Also:
setShowVerticalLines(boolean)
, setShowGrid(boolean)
, getShowHorizontalLines()
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public void setShowVerticalLines(boolean showVerticalLines)
- See Also:
setShowHorizontalLines(boolean)
, setShowGrid(boolean)
, getShowVerticalLines()
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public void setSurrendersFocusOnKeystroke(boolean surrendersFocusOnKeystroke)
- See Also:
getSurrendersFocusOnKeystroke()
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public void setTableHeader(JTableHeader tableHeader)
- See Also:
getTableHeader()
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public void setUI(TableUI ui)
- See Also:
UIDefaults.getUI(javax.swing.JComponent)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public void setValueAt(Object aValue,
int row,
int column)
- See Also:
getValueAt(int, int)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
[715]_
By yaldhamary { at } hotmail { dot } com on 2004/03/31 05:40:27 Rate
setValueAt ( JTextField,7,8 ) ;
protected boolean showHorizontalLines
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
protected boolean showVerticalLines
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
@Deprecated
public void sizeColumnsToFit(boolean lastColumnOnly)
- See Also:
doLayout()
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public void sizeColumnsToFit(int resizingColumn)
- See Also:
doLayout()
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public void tableChanged(TableModelEvent e)
- See Also:
- TableModelListener
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
protected JTableHeader tableHeader
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
protected void unconfigureEnclosingScrollPane()
- See Also:
configureEnclosingScrollPane()
, removeNotify()
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public void updateUI()
- See Also:
- JComponent
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public void valueChanged(ListSelectionEvent e)
- See Also:
ListSelectionListener
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples