本文整理匯總了Java中org.jdesktop.swingx.JXTable.setColumnModel方法的典型用法代碼示例。如果您正苦於以下問題:Java JXTable.setColumnModel方法的具體用法?Java JXTable.setColumnModel怎麽用?Java JXTable.setColumnModel使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.jdesktop.swingx.JXTable
的用法示例。
在下文中一共展示了JXTable.setColumnModel方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: interactiveTestColumnControlColumnModel
import org.jdesktop.swingx.JXTable; //導入方法依賴的package包/類
/**
* Issue ??: Column control on changing column model.
*
*/
public void interactiveTestColumnControlColumnModel() {
final JXTable table = new JXTable(10, 5);
table.setColumnControlVisible(true);
Action toggleAction = new AbstractAction("Set ColumnModel") {
@Override
public void actionPerformed(ActionEvent e) {
table.setColumnModel(new DefaultTableColumnModel());
table.setModel(new AncientSwingTeam());
setEnabled(false);
}
};
JXFrame frame = wrapWithScrollingInFrame(table,
"ColumnControl: set columnModel ext -> core default");
addAction(frame, toggleAction);
frame.setVisible(true);
}
示例2: interactiveTestColumnControlColumnModelExt
import org.jdesktop.swingx.JXTable; //導入方法依賴的package包/類
/**
* Issue ??: Column control cancontrol update on changing column model.
*
*/
public void interactiveTestColumnControlColumnModelExt() {
final JXTable table = new JXTable();
table.setColumnModel(new DefaultTableColumnModel());
table.setModel(new DefaultTableModel(10, 5));
table.setColumnControlVisible(true);
Action toggleAction = new AbstractAction("Set ColumnModelExt") {
@Override
public void actionPerformed(ActionEvent e) {
table.setColumnModel(new DefaultTableColumnModelExt());
table.setModel(new AncientSwingTeam());
table.getColumnExt(0).setVisible(false);
setEnabled(false);
}
};
JXFrame frame = wrapWithScrollingInFrame(table,
"ColumnControl: set ColumnModel core -> modelExt");
addAction(frame, toggleAction);
frame.setVisible(true);
}