当前位置: 首页>>代码示例>>Java>>正文


Java TableColumnExt.setWidth方法代码示例

本文整理汇总了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());
	}
}
 
开发者ID:metasfresh,项目名称:metasfresh,代码行数:24,代码来源:FileImportPreviewColumnFactory.java

示例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();
}
 
开发者ID:Torridity,项目名称:dsworkbench,代码行数:16,代码来源:DSWorkbenchWatchtowerFrame.java

示例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);
}
 
开发者ID:Torridity,项目名称:dsworkbench,代码行数:37,代码来源:DSWorkbenchDistanceFrame.java

示例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);
    }
}
 
开发者ID:Torridity,项目名称:dsworkbench,代码行数:9,代码来源:UIHelper.java

示例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);
}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:15,代码来源:XProperties.java


注:本文中的org.jdesktop.swingx.table.TableColumnExt.setWidth方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。