本文整理匯總了Java中org.jdesktop.swingx.JXTable.setVisibleRowCount方法的典型用法代碼示例。如果您正苦於以下問題:Java JXTable.setVisibleRowCount方法的具體用法?Java JXTable.setVisibleRowCount怎麽用?Java JXTable.setVisibleRowCount使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.jdesktop.swingx.JXTable
的用法示例。
在下文中一共展示了JXTable.setVisibleRowCount方法的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: interactiveTableBorderHighlighter
import org.jdesktop.swingx.JXTable; //導入方法依賴的package包/類
/**
* Show variants of border Highlighters.
*
*/
public void interactiveTableBorderHighlighter() {
JXTable table = new JXTable(tableModel);
table.setVisibleRowCount(table.getRowCount());
table.setVisibleColumnCount(7);
table.packAll();
table.setColumnControlVisible(true);
BorderHighlighter outer = new BorderHighlighter(new HighlightPredicate.ColumnHighlightPredicate(1),
BorderFactory.createLineBorder(Color.RED, 3));
BorderHighlighter inner = new BorderHighlighter(new HighlightPredicate.ColumnHighlightPredicate(2),
BorderFactory.createLineBorder(Color.RED, 3), true, true);
BorderHighlighter replace = new BorderHighlighter(new HighlightPredicate.ColumnHighlightPredicate(0),
BorderFactory.createLineBorder(Color.RED, 3), false, true);
table.setHighlighters(outer, inner, replace);
showWithScrollingInFrame(table, "Border Highlighters");
}
示例2: interactiveTablePatternHighlighterJP
import org.jdesktop.swingx.JXTable; //導入方法依賴的package包/類
/**
* Multiple Highlighters (shown as example in Javapolis 2007).
*
*/
public void interactiveTablePatternHighlighterJP() {
JXTable table = new JXTable(tableModel);
table.setVisibleRowCount(table.getRowCount());
table.setVisibleColumnCount(7);
table.packAll();
table.setColumnControlVisible(true);
Font font = table.getFont().deriveFont(Font.BOLD | Font.ITALIC);
Highlighter simpleStriping = HighlighterFactory.createSimpleStriping();
PatternPredicate patternPredicate = new PatternPredicate("^M", 1);
ColorHighlighter magenta = new ColorHighlighter(patternPredicate, null,
Color.MAGENTA, null, Color.MAGENTA);
FontHighlighter derivedFont = new FontHighlighter(patternPredicate,
font);
AbstractHighlighter gradient = createRelativeGradientHighlighter(HorizontalAlignment.LEFT, AncientSwingTeam.INTEGER_COLUMN);
gradient.setHighlightPredicate(new HighlightPredicate.ColumnHighlightPredicate(AncientSwingTeam.INTEGER_COLUMN));
LOG.info("" + (table.getValueAt(0, 3) instanceof Number));
Highlighter shading = new ShadingColorHighlighter(
new HighlightPredicate.ColumnHighlightPredicate(1));
table.setHighlighters(simpleStriping, magenta, derivedFont, shading //);
, gradient);
showWithScrollingInFrame(table, "Multiple Highlighters");
}
示例3: interactiveSimpleStriping
import org.jdesktop.swingx.JXTable; //導入方法依賴的package包/類
/**
* shows the effect of a simple striping highlighter on a
* colored table.
*
*/
public void interactiveSimpleStriping() {
JXTable table = new JXTable(tableModel);
table.setVisibleRowCount(table.getRowCount() + 3);
table.setBackground(new Color(0xC0FFC0));
table.addHighlighter(HighlighterFactory.createSimpleStriping());
Highlighter disabled = new AbstractHighlighter(HighlightPredicate.READ_ONLY) {
@Override
protected Component doHighlight(Component component,
ComponentAdapter adapter) {
component.setEnabled(false);
return component;
}
};
table.getColumnExt(0).setEditable(false);
table.getColumnExt(2).setEditable(false);
table.getColumnExt(0).setCellRenderer(new DefaultTableRenderer(new TextFieldProvider()));
table.addHighlighter(disabled);
showWithScrollingInFrame(table, "Simple gray striping");
}
示例4: interactiveXLabelRenderer
import org.jdesktop.swingx.JXTable; //導入方法依賴的package包/類
/**
* Quick example of using a JXLabel as rendering component.
* Looks funny .. wrapping jumps?
*/
public void interactiveXLabelRenderer() {
DefaultTableModel model = new DefaultTableModel(0, 1);
model.addRow(new String[] {"some really, maybe really really long text - "
+ "wrappit .... where needed "});
model.addRow(new String[] {"another really, maybe really really long text - "
+ "with nothing but junk. wrappit .... where needed"});
JXTable table = new JXTable(model);
table.setVisibleRowCount(4);
table.setVisibleColumnCount(2);
table.setColumnControlVisible(true);
table.getColumnExt(0).setCellRenderer(new DefaultTableRenderer(new XLabelProvider()));
table.addHighlighter(
HighlighterFactory.createAlternateStriping());
table.setRowHeight(50);
showWithScrollingInFrame(table, "textArea as rendering comp");
}
示例5: interactiveSimpleStripingUI
import org.jdesktop.swingx.JXTable; //導入方法依賴的package包/類
/**
* Simple ui-striping.
*
*/
public void interactiveSimpleStripingUI() {
JXTable table = new JXTable(tableModel);
table.setVisibleRowCount(table.getRowCount() + 3);
table.addHighlighter(HighlighterFactory.createSimpleStriping());
showWithScrollingInFrame(table, "Simple ui striping");
}
示例6: interactiveSimpleStripingGroup
import org.jdesktop.swingx.JXTable; //導入方法依賴的package包/類
/**
* shows the effect of a simple striping highlighter on a
* colored table.
*
*/
public void interactiveSimpleStripingGroup() {
JXTable table = new JXTable(tableModel);
table.setVisibleRowCount(table.getRowCount() + 3);
table.setBackground(Color.YELLOW);
table.addHighlighter(HighlighterFactory.createSimpleStriping(Color.LIGHT_GRAY, 3));
showWithScrollingInFrame(table, "Simple gray striping, grouped by 3");
}
示例7: interactiveAlternateStriping
import org.jdesktop.swingx.JXTable; //導入方法依賴的package包/類
/**
* shows the effect of a simple striping highlighter on a
* colored table.
*
*/
public void interactiveAlternateStriping() {
JXTable table = new JXTable(tableModel);
table.setVisibleRowCount(table.getRowCount() + 3);
table.setBackground(Color.YELLOW);
table.addHighlighter(HighlighterFactory.createAlternateStriping(Color.WHITE, Color.LIGHT_GRAY));
showWithScrollingInFrame(table, "Alternate white/gray striping");
}
示例8: interactiveAlternateStripingGroup
import org.jdesktop.swingx.JXTable; //導入方法依賴的package包/類
/**
* shows the effect of a simple striping highlighter on a
* colored table.
*
*/
public void interactiveAlternateStripingGroup() {
JXTable table = new JXTable(tableModel);
table.setVisibleRowCount(table.getRowCount() + 3);
table.setBackground(Color.YELLOW);
table.addHighlighter(HighlighterFactory.createAlternateStriping(Color.WHITE, Color.LIGHT_GRAY, 3));
showWithScrollingInFrame(table, "Alternate white/gray striping");
}
示例9: 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+"");
}
示例10: createHyperlinkDemo
import org.jdesktop.swingx.JXTable; //導入方法依賴的package包/類
private void createHyperlinkDemo() {
JXTitledSeparator simple = new JXTitledSeparator();
simple.setName("simpleSeparator");
plainBrowse = new JXHyperlink();
plainBrowse.setName("plainBrowse");
plainMail = new JXHyperlink();
plainMail.setName("plainMail");
customBrowse = new JXHyperlink();
customBrowse.setName("customBrowse");
JXTitledSeparator custom = new JXTitledSeparator();
custom.setName("customSeparator");
customLink = new JXHyperlink();
customLink.setName("customLink");
JComponent standaloneLinks = new JXPanel(new VerticalLayout(20));
standaloneLinks.add(simple);
standaloneLinks.add(plainBrowse);
standaloneLinks.add(plainMail);
standaloneLinks.add(customBrowse);
standaloneLinks.add(custom);
standaloneLinks.add(customLink);
standaloneLinks.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
JComponent renderedLinks = new JXPanel(new BorderLayout());
linkList = new JXList();
linkTable = new JXTable();
linkTable.setVisibleRowCount(10);
linkTree = new JXTree();
JXPanel top = new JXPanel(new GridLayout(1, 2, 20, 10));
top.add(new JScrollPane(linkList));
top.add(new JScrollPane(linkTree));
renderedLinks.add(top);
// renderedLinks.add(new JScrollPane(linkTable), BorderLayout.SOUTH);
renderedLinks.setBorder(standaloneLinks.getBorder());
JTabbedPane tabbedPane = new JTabbedPane();
tabbedPane.setName("hyperlinkTabs");
addTab(tabbedPane, standaloneLinks, "standaloneTab", false);
addTab(tabbedPane, renderedLinks, "renderedTab", false);
add(tabbedPane);
}
示例11: 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();
}
}