本文整理汇总了Java中org.jdesktop.swingx.table.TableColumnExt.setHeaderValue方法的典型用法代码示例。如果您正苦于以下问题:Java TableColumnExt.setHeaderValue方法的具体用法?Java TableColumnExt.setHeaderValue怎么用?Java TableColumnExt.setHeaderValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jdesktop.swingx.table.TableColumnExt
的用法示例。
在下文中一共展示了TableColumnExt.setHeaderValue方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testPrefColumnTitle
import org.jdesktop.swingx.table.TableColumnExt; //导入方法依赖的package包/类
/**
* Issue #547-swingx: columns' pref width - header not taken
* if no prototype
*
*/
@Test
public void testPrefColumnTitle() {
JXTable table = new JXTable(new AncientSwingTeam());
TableColumnExt columnExt = table.getColumnExt(0);
columnExt.setHeaderValue("Jessesmariaandjosefsapperlottodundteufel");
TableCellRenderer renderer = table.getTableHeader().getDefaultRenderer();
Component comp = renderer.getTableCellRendererComponent(table, columnExt.getHeaderValue(), false, false, -1, -1);
// need to store the pref - header renderer is used during initialize!
Dimension prefSize = comp.getPreferredSize();
// make sure the column pref is initialized
table.initializeColumnWidths();
assertEquals("header must be measured",
prefSize.width + table.getColumnMargin(), columnExt.getPreferredWidth());
}
示例2: ReturnsSummaryTableColumnModel
import org.jdesktop.swingx.table.TableColumnExt; //导入方法依赖的package包/类
public ReturnsSummaryTableColumnModel(List<String> columns) {
for (int i = 0; i < columns.size(); i++) {
TableColumnExt tableColumn = new TableColumnExt(i);
if (i > 0 && i < columns.size() - 1) {
tableColumn.setCellRenderer(selectedReturnCellRenderer);
} else if (i == (columns.size() - 1)) {
tableColumn.setCellRenderer(totalReturnCellRenderer);
}
tableColumn.setIdentifier(columns.get(i));
tableColumn.setHeaderValue(TextToHtmlSplitter.instance.split(columns.get(i)));
addColumn(tableColumn);
}
}
示例3: StatisticsTableColumnModel
import org.jdesktop.swingx.table.TableColumnExt; //导入方法依赖的package包/类
public StatisticsTableColumnModel(String... columns) {
for (int i = 0; i < columns.length; i++) {
TableColumnExt tableColumn = new TableColumnExt(i);
tableColumn.setHeaderValue(TextToHtmlSplitter.instance.split(columns[i]));
if (i == 0) tableColumn.setPreferredWidth(100);
addColumn(tableColumn);
}
}
示例4: TickerCompanyTableColumnModel
import org.jdesktop.swingx.table.TableColumnExt; //导入方法依赖的package包/类
public TickerCompanyTableColumnModel(String... columns) {
for (int i = 0; i < columns.length; i++) {
TableColumnExt tableColumn = new TableColumnExt(i);
tableColumn.setHeaderValue(TextToHtmlSplitter.instance.split(columns[i]));
if (i == 0) {
tableColumn.setMaxWidth(75);
}
addColumn(tableColumn);
}
}
示例5: PropertiesTableColumnModel
import org.jdesktop.swingx.table.TableColumnExt; //导入方法依赖的package包/类
public PropertiesTableColumnModel(String[] columns) {
for (int i = 0; i < columns.length; i++) {
TableColumnExt tableColumn = new TableColumnExt(i);
tableColumn.setHeaderValue(columns[i]);
addColumn(tableColumn);
}
}
示例6: StatisticsTableColumnModel
import org.jdesktop.swingx.table.TableColumnExt; //导入方法依赖的package包/类
public StatisticsTableColumnModel(String... columns) {
for (int i = 0; i < columns.length; i++) {
TableColumnExt tableColumn = new TableColumnExt(i);
tableColumn.setHeaderValue(TextToHtmlSplitter.instance.split(columns[i]));
if (i == 0) {
tableColumn.setMaxWidth(75);
}
addColumn(tableColumn);
}
}
示例7: StatisticsTableColumnModel
import org.jdesktop.swingx.table.TableColumnExt; //导入方法依赖的package包/类
public StatisticsTableColumnModel(String defaultColumn, Set<String> columns) {
List<String> tableColumns = new ArrayList<String>(columns);
tableColumns.add(0, defaultColumn);
for (int i = 0; i < tableColumns.size(); i++) {
TableColumnExt tableColumn = new TableColumnExt(i);
tableColumn.setHeaderValue(TextToHtmlSplitter.instance.split(tableColumns.get(i)));
addColumn(tableColumn);
}
}
示例8: StatisticsTableColumnModel
import org.jdesktop.swingx.table.TableColumnExt; //导入方法依赖的package包/类
public StatisticsTableColumnModel(String... columns) {
for (int i = 0; i < columns.length; i++) {
TableColumnExt tableColumn = new TableColumnExt(i);
tableColumn.setCellRenderer(statisticsTableCellRenderer);
tableColumn.setHeaderValue(TextToHtmlSplitter.instance.split(columns[i]));
if (i == 0) {
tableColumn.setPreferredWidth(165);
}
tableColumn.setSortable(false);
addColumn(tableColumn);
}
getSelectionModel().addListSelectionListener(statisticsListSelectionListener);
}
示例9: StockTableColumnModel
import org.jdesktop.swingx.table.TableColumnExt; //导入方法依赖的package包/类
public StockTableColumnModel(List<String> columns) {
for (int i = 0; i < columns.size(); i++) {
TableColumnExt tableColumn = new TableColumnExt(i);
tableColumn.setCellRenderer(stockTableColumnCellRenderer);
tableColumn.setHeaderValue(TextToHtmlSplitter.instance.split(columns.get(i)));
addColumn(tableColumn);
}
}