public class JTableButtonCell
extends javax.swing.AbstractCellEditor
implements javax.swing.table.TableCellRenderer, javax.swing.table.TableCellEditor, java.awt.event.ActionListener, java.awt.event.MouseListener
Constructor and Description |
---|
JTableButtonCell(javax.swing.JTable table,
javax.swing.Action action,
int column)
Create the JTableButtonCell to be used as a renderer and editor.
|
Modifier and Type | Method and Description |
---|---|
void |
actionPerformed(java.awt.event.ActionEvent e) |
java.lang.Object |
getCellEditorValue() |
javax.swing.border.Border |
getFocusBorder()
Get foreground color of the button when the cell has focus
|
int |
getMnemonic() |
java.awt.Component |
getTableCellEditorComponent(javax.swing.JTable table,
java.lang.Object value,
boolean isSelected,
int row,
int column) |
java.awt.Component |
getTableCellRendererComponent(javax.swing.JTable table,
java.lang.Object value,
boolean isSelected,
boolean hasFocus,
int row,
int column) |
void |
mouseClicked(java.awt.event.MouseEvent e) |
void |
mouseEntered(java.awt.event.MouseEvent e) |
void |
mouseExited(java.awt.event.MouseEvent e) |
void |
mousePressed(java.awt.event.MouseEvent e) |
void |
mouseReleased(java.awt.event.MouseEvent e) |
void |
setFocusBorder(javax.swing.border.Border focusBorder)
The foreground color of the button when the cell has focus
|
void |
setMnemonic(int mnemonic)
The mnemonic to activate the button when the cell has focus
|
addCellEditorListener, cancelCellEditing, fireEditingCanceled, fireEditingStopped, getCellEditorListeners, isCellEditable, removeCellEditorListener, shouldSelectCell, stopCellEditing
public JTableButtonCell(javax.swing.JTable table, javax.swing.Action action, int column)
table
- the table containing the button renderer/editoraction
- the Action to be invoked when the button is invokedcolumn
- the column to which the button renderer/editor is addedpublic javax.swing.border.Border getFocusBorder()
public void setFocusBorder(javax.swing.border.Border focusBorder)
focusBorder
- the foreground colorpublic int getMnemonic()
public void setMnemonic(int mnemonic)
mnemonic
- the mnemonicpublic java.awt.Component getTableCellEditorComponent(javax.swing.JTable table, java.lang.Object value, boolean isSelected, int row, int column)
getTableCellEditorComponent
in interface javax.swing.table.TableCellEditor
public java.lang.Object getCellEditorValue()
getCellEditorValue
in interface javax.swing.CellEditor
public java.awt.Component getTableCellRendererComponent(javax.swing.JTable table, java.lang.Object value, boolean isSelected, boolean hasFocus, int row, int column)
getTableCellRendererComponent
in interface javax.swing.table.TableCellRenderer
public void actionPerformed(java.awt.event.ActionEvent e)
actionPerformed
in interface java.awt.event.ActionListener
public void mousePressed(java.awt.event.MouseEvent e)
mousePressed
in interface java.awt.event.MouseListener
public void mouseReleased(java.awt.event.MouseEvent e)
mouseReleased
in interface java.awt.event.MouseListener
public void mouseClicked(java.awt.event.MouseEvent e)
mouseClicked
in interface java.awt.event.MouseListener
public void mouseEntered(java.awt.event.MouseEvent e)
mouseEntered
in interface java.awt.event.MouseListener
public void mouseExited(java.awt.event.MouseEvent e)
mouseExited
in interface java.awt.event.MouseListener