本文整理汇总了Java中org.jdesktop.swingx.table.TableColumnExt.setWidth方法的典型用法代码示例。如果您正苦于以下问题:Java TableColumnExt.setWidth方法的具体用法?Java TableColumnExt.setWidth怎么用?Java TableColumnExt.setWidth使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jdesktop.swingx.table.TableColumnExt
的用法示例。
在下文中一共展示了TableColumnExt.setWidth方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: configureTableColumn
import org.jdesktop.swingx.table.TableColumnExt; //导入方法依赖的package包/类
@Override
public void configureTableColumn(final TableModel model, final TableColumnExt columnExt)
{
super.configureTableColumn(model, columnExt);
final TableColumnModel columnModel = getTableColumnModelOrNull(model, columnExt);
if (columnModel == null)
{
return;
}
final int width = columnModel.getWidth();
if (width > 0)
{
columnExt.setWidth(width);
columnExt.setMaxWidth(width);
}
if (columnModel instanceof ImpDataLineRowTableColumnModel)
{
columnExt.setCellRenderer(new ImpDataCellRenderer());
}
}
示例2: resetView
import org.jdesktop.swingx.table.TableColumnExt; //导入方法依赖的package包/类
@Override
public void resetView() {
KnownVillageManager.getSingleton().addManagerListener(this);
MarkerManager.getSingleton().addManagerListener(this);
jWatchtowerTable.getTableHeader().setDefaultRenderer(new DefaultTableHeaderRenderer());
String[] cols = new String[]{"Stufe", "Farbe"};
for (String col : cols) {
TableColumnExt columns = jWatchtowerTable.getColumnExt(col);
columns.setPreferredWidth(80);
columns.setMaxWidth(80);
columns.setWidth(80);
}
((WatchtowerTableModel) jWatchtowerTable.getModel()).fireTableDataChanged();
}
示例3: resetView
import org.jdesktop.swingx.table.TableColumnExt; //导入方法依赖的package包/类
public void resetView(boolean pClear) {
if (pClear) {
DistanceManager.getSingleton().clear();
}
jDistanceTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
int w0 = 200;
for (int i = 0; i < jDistanceTable.getColumnCount(); i++) {
TableColumnExt column = jDistanceTable.getColumnExt(i);
if (i == 0) {
column.setWidth(w0);
column.setPreferredWidth(w0);
column.setMaxWidth(w0);
column.setMinWidth(w0);
column.setResizable(false);
} else {
String v = (String) column.getHeaderValue();
int w = getGraphics().getFontMetrics().stringWidth(v);
column.setWidth(w);
column.setPreferredWidth(w);
}
}
jDistanceTable.getTableHeader().setDefaultRenderer(new DefaultTableHeaderRenderer());
if (pClear) {
((DistanceTableModel) jDistanceTable.getModel()).fireTableStructureChanged();
} else {
((DistanceTableModel) jDistanceTable.getModel()).fireTableDataChanged();
}
DefaultComboBoxModel model = new DefaultComboBoxModel();
model.addElement(UnknownUnit.getSingleton());
for (UnitHolder unit : DataHolder.getSingleton().getUnits()) {
model.addElement(unit);
}
unitBox.setModel(model);
}
示例4: initTableColums
import org.jdesktop.swingx.table.TableColumnExt; //导入方法依赖的package包/类
public static void initTableColums(JXTable table, int width, String... headers) {
for (String caption : headers) {
TableColumnExt columns = table.getColumnExt(caption);
columns.setPreferredWidth(width);
columns.setMaxWidth(width);
columns.setWidth(width);
}
}
示例5: configureColumn
import org.jdesktop.swingx.table.TableColumnExt; //导入方法依赖的package包/类
/**
* Restores column properties if the model index is the same as the
* column's model index. Does nothing otherwise. <p>
*
* Here the properties are: width, preferredWidth, visible.
*
* @param columnExt the column to configure
*/
public void configureColumn(TableColumnExt columnExt) {
if (modelIndex != columnExt.getModelIndex()) return;
columnExt.setPreferredWidth(preferredWidth);
columnExt.setWidth(width);
columnExt.setVisible(visible);
}