本文整理匯總了Java中javax.swing.table.TableColumn.getCellRenderer方法的典型用法代碼示例。如果您正苦於以下問題:Java TableColumn.getCellRenderer方法的具體用法?Java TableColumn.getCellRenderer怎麽用?Java TableColumn.getCellRenderer使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類javax.swing.table.TableColumn
的用法示例。
在下文中一共展示了TableColumn.getCellRenderer方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getCellRenderer
import javax.swing.table.TableColumn; //導入方法依賴的package包/類
/** Always returns the default renderer for Object.class for the tree column */
@Override
public TableCellRenderer getCellRenderer(int row, int column) {
int c = convertColumnIndexToModel(column);
TableCellRenderer result;
if (c == 0) {
TableColumn tableColumn = getColumnModel().getColumn(column);
TableCellRenderer renderer = tableColumn.getCellRenderer();
if (renderer == null) {
result = getDefaultRenderer(Object.class);
} else {
result = renderer;
}
} else {
result = super.getCellRenderer(row, column);
}
return result;
}
示例2: getCellRenderer
import javax.swing.table.TableColumn; //導入方法依賴的package包/類
public TableCellRenderer getCellRenderer(int row, int column) {
TableColumn tableColumn = getColumnModel().getColumn(column);
TableCellRenderer renderer = tableColumn.getCellRenderer();
if (renderer == null) {
Class<?> c = getColumnClass(column);
if( c.equals(Object.class) )
{
Object o = getValueAt(row,column);
if( o != null )
c = getValueAt(row,column).getClass();
}
renderer = getDefaultRenderer(c);
}
return renderer;
}
示例3: copyValues
import javax.swing.table.TableColumn; //導入方法依賴的package包/類
public void copyValues(TableColumn base) {
modelIndex = base.getModelIndex();
identifier = base.getIdentifier();
width = base.getWidth();
minWidth = base.getMinWidth();
setPreferredWidth(base.getPreferredWidth());
maxWidth = base.getMaxWidth();
headerRenderer = base.getHeaderRenderer();
headerValue = base.getHeaderValue();
cellRenderer = base.getCellRenderer();
cellEditor = base.getCellEditor();
isResizable = base.getResizable();
}
示例4: findTotalMaximumRowSize
import javax.swing.table.TableColumn; //導入方法依賴的package包/類
/**
* Look through all columns and get the renderer. If it is
* also a TextAreaRenderer, we look at the maximum height in
* its hash table for this row.
*/
private int findTotalMaximumRowSize(JTable table, int row) {
int maximum_height = 0;
Enumeration columns = table.getColumnModel().getColumns();
while (columns.hasMoreElements()) {
TableColumn tc = (TableColumn) columns.nextElement();
TableCellRenderer cellRenderer = tc.getCellRenderer();
if (cellRenderer instanceof TextAreaRenderer) {
TextAreaRenderer tar = (TextAreaRenderer) cellRenderer;
maximum_height = Math.max(maximum_height, findMaximumRowSize(table, row));
}
}
return maximum_height;
}
示例5: setRenderer
import javax.swing.table.TableColumn; //導入方法依賴的package包/類
private static void setRenderer(TableColumn column) {
if (!(column.getCellRenderer() instanceof TableClassNameRenderer)) {
column.setCellRenderer(new TableClassNameRenderer());
}
}