本文整理匯總了Java中org.jdesktop.swingx.JXTable.setShowGrid方法的典型用法代碼示例。如果您正苦於以下問題:Java JXTable.setShowGrid方法的具體用法?Java JXTable.setShowGrid怎麽用?Java JXTable.setShowGrid使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.jdesktop.swingx.JXTable
的用法示例。
在下文中一共展示了JXTable.setShowGrid方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: initJTableFiles
import org.jdesktop.swingx.JXTable; //導入方法依賴的package包/類
private void initJTableFiles() {
jTableFiles = new JXTable();
jTableFilesTableModel = new DBMSImportTableModel(jTableFiles);
jTableFiles.setColumnControlVisible(true);
jTableFiles.setEditable(false);
jTableFiles.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
jTableFiles.setModel(jTableFilesTableModel);
jTableFiles.setShowGrid(true);
jTableFiles.setDragEnabled(false);
jTableFiles.getSelectionModel().addListSelectionListener(new ListSelectionListener() {
@Override
public void valueChanged(ListSelectionEvent e) {
if(jTableFiles.getSelectedRow() < 0) {
delFileButton.setEnabled(false);
}else{
delFileButton.setEnabled(true);
}
}
});
scrollPaneFiles.setViewportView(jTableFiles);
}
示例2: initJTable
import org.jdesktop.swingx.JXTable; //導入方法依賴的package包/類
private void initJTable() {
valueTable = new JXTable();
valueTable.setColumnControlVisible(true);
valueTable.setEditable(false);
valueTable.setDefaultRenderer(Object.class, new TableValueCellRender());
valueTable.setCellSelectionEnabled(true);
valueTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
valueTable.setModel(dataModel);
valueTable.setShowGrid(true);
valueTable.setDragEnabled(false);
valueTable.setSelectionBackground(new Color(214, 217, 223));
valueTable.setVisibleRowCount(20);
pageCtrlPanel.setVisibleRow(20+"");
}
示例3: initTable
import org.jdesktop.swingx.JXTable; //導入方法依賴的package包/類
private void initTable() {
table = new JXTable();
table.setColumnControlVisible(true);
table.setEditable(true);
table.setCellSelectionEnabled(true);
table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
table.setShowGrid(true);
table.setDragEnabled(false);
table.setSelectionBackground(new Color(214, 217, 223));
highlighterControl = new HighlighterControl();
}
示例4: initTable
import org.jdesktop.swingx.JXTable; //導入方法依賴的package包/類
private void initTable() {
cellChangesTable = new JXTable();
cellChangesTable.setEditable(false);
cellChangesTable.setColumnControlVisible(true);
cellChangesTable.setShowGrid(true);
cellChangesTable.setDragEnabled(false);
cellChangesTable.setSelectionBackground(new Color(214, 217, 223));
cellChangesTable.setModel(model);
}
示例5: initUi
import org.jdesktop.swingx.JXTable; //導入方法依賴的package包/類
private void initUi() {
try {
setLayout(new MigLayout("fill,flowy"));
setTitle("JXTableTest01");
setPreferredSize(new Dimension(600, 400));
setLocation(400, 200);
setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
tfFilter = new JTextField(20);
tfFilter.addActionListener(this);
btAdd = new JButton("Add");
btAdd.addActionListener(this);
Vector<Vector<String>> data = new Vector<Vector<String>>();
for (int i = 0; i < 2; ++i) {
Vector<String> row = new Vector<String>();
row.add("name " + i + " 01");
row.add("city " + i + " 02");
data.add(row);
}
Vector<String> columnNames = new Vector<String>();
columnNames.add("col 1");
columnNames.add("col 2");
model = new DefaultTableModel(data, columnNames);
table = new JXTable(model);
table.setColumnControlVisible(true);
table.setShowGrid(false, false);
table.addHighlighter(HighlighterFactory.createSimpleStriping());
table.setVisibleRowCount(10);
rowFilter = new SbRowFilter(table);
add(tfFilter);
add(btAdd);
JScrollPane scroller = new JScrollPane(table);
add(scroller, "grow");
pack();
setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}