本文整理汇总了Java中javax.swing.ScrollPaneLayout类的典型用法代码示例。如果您正苦于以下问题:Java ScrollPaneLayout类的具体用法?Java ScrollPaneLayout怎么用?Java ScrollPaneLayout使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ScrollPaneLayout类属于javax.swing包,在下文中一共展示了ScrollPaneLayout类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testColumnControlOnUpdateUI
import javax.swing.ScrollPaneLayout; //导入依赖的package包/类
/**
* Issue #1392-swingx: ColumnControl lost on change of CO and LAF
*/
@Test
public void testColumnControlOnUpdateUI() {
JXTable table = new JXTable(10, 2);
JScrollPane scrollPane = new JScrollPane(table);
table.setColumnControlVisible(true);
scrollPane.setLayout(new ScrollPaneLayout());
assertSame("sanity: column control survives setLayout",
table.getColumnControl(), scrollPane.getCorner(JScrollPane.UPPER_TRAILING_CORNER));
toggleComponentOrientation(scrollPane);
// scrollPane.setLayout(new ScrollPaneLayout());
assertSame("sanity: column control in trailing corner",
table.getColumnControl(), scrollPane.getCorner(JScrollPane.UPPER_TRAILING_CORNER));
assertNull("column control must not be in leading corner",
scrollPane.getCorner(JScrollPane.UPPER_LEADING_CORNER));
}
示例2: interactiveColumnControlLAF
import javax.swing.ScrollPaneLayout; //导入依赖的package包/类
/**
* Issue #1392- swingx: columnControl lost on toggle CO and LAF
*
* Not easily reproducible - happens
* if the scrollPane's layout is re-created on updateUI.
*/
public void interactiveColumnControlLAF() {
JXTable table = new JXTable(new AncientSwingTeam());
table.setColumnControlVisible(true);
JScrollPane scrollPane = new JScrollPane(table) {
/**
* @inherited <p>
*/
@Override
public void updateUI() {
super.updateUI();
setLayout(new ScrollPaneLayout());
}
};
JTable rowHeader = new JTable(10, 1);
scrollPane.setRowHeaderView(rowHeader);
JLabel label = new JLabel("rowHeader");
scrollPane.setCorner(JScrollPane.UPPER_LEADING_CORNER, label);
JXFrame frame = wrapInFrame(scrollPane, "xTable, coreScrollPane");
addComponentOrientationToggle(frame);
show(frame);
}
示例3: showTop
import javax.swing.ScrollPaneLayout; //导入依赖的package包/类
/**
* Shows the top n records in the database.
*
* @param n
* The number of records to show from the top.
*/
public void showTop(int n) {
JPanel panel = new JPanel();
panel.setLayout(new BoxLayout(panel, BoxLayout.PAGE_AXIS));
// Header
panel.add(recordPanelHeaderBuilder());
for (Record record : records.getTopRecords(n))
panel.add(oneRecordPanelBuilder(record));
JScrollPane pane = new JScrollPane(panel);
pane.setLayout(new ScrollPaneLayout());
add(pane);
add(buttonsBuilder(), BorderLayout.SOUTH);
showWindow();
}
示例4: AbstractList
import javax.swing.ScrollPaneLayout; //导入依赖的package包/类
public AbstractList() {
GridBagLayout gbl = new GridBagLayout();
this.setLayout(gbl);
toolbarPanel.setLayout(gbl_toolbarPanel);
bottombarPanel.setLayout(gbl_bottombarPanel);
final JScrollPane scrollPane = new JScrollPane(this.content);
ScrollPaneLayout spl = new ScrollPaneLayout();
scrollPane.setLayout(spl);
scrollPane.setBackground(Color.WHITE);
scrollPane.setOpaque(true);
JScrollBar vertScrollBar = new JScrollBar();
vertScrollBar.setUnitIncrement(100);
JScrollBar horScrollBar = new JScrollBar(JScrollBar.HORIZONTAL);
horScrollBar.setUnitIncrement(100);
scrollPane.setVerticalScrollBar(vertScrollBar);
scrollPane.setHorizontalScrollBar(horScrollBar);
endPanel.setBackground(Color.WHITE);
SwingUtil.addComponent(this, gbl, toolbarPanel, 0, 0, 1, 1, 1.0, 0.0,
GridBagConstraints.NORTHWEST, GridBagConstraints.BOTH);
SwingUtil.addComponent(this, gbl, scrollPane, 0, 1, 1, 1, 0.0, 1.0,
GridBagConstraints.NORTHWEST, GridBagConstraints.BOTH);
SwingUtil.addComponent(this, gbl, bottombarPanel, 0, 2, 1, 1, 1.0, 0.0,
GridBagConstraints.NORTHWEST, GridBagConstraints.BOTH);
border = BorderFactory.createEmptyBorder();
this.setBorder(border);
// border = BorderFactory.createLineBorder(new Color(0, 100, 100, 70));
this.content.setBackground(Color.WHITE);
}
示例5: installUI
import javax.swing.ScrollPaneLayout; //导入依赖的package包/类
public void installUI(final JComponent c) {
scrollpane = (JScrollPane)c;
installDefaults(scrollpane);
installListeners(scrollpane);
installKeyboardActions(scrollpane);
scrollpane.setLayout(new ScrollPaneLayout());
}
示例6: ThreadSelectionPane
import javax.swing.ScrollPaneLayout; //导入依赖的package包/类
@SuppressWarnings("serial")
public ThreadSelectionPane(Session main) {
super(new BorderLayout());
this.main = main;
this.store = main.getStore();
this.selectionHistory = new Stack<Selection>();
this.blocks = new ArrayList<ThreadBlock>();
this.popup = new ThreadSelectionPanePopupMenu(this);
threadSelectionType = ThreadSelectionType.ALL;
selectionHistory.push(new Selection());
label = new JLabel();
label.setFont(new Font("Arial", Font.PLAIN, 10));
label.setOpaque(true);
label.setBackground(Color.WHITE);
axis = new ThreadSelectionTimeAxis(this);
blocksPane = new BlocksPane();
blocksPane.addMouseMotionListener(this);
blocksPane.addMouseListener(this);
blocksPane.setFocusable(true);
blocksPane.addKeyListener(this);
blocksPane.addComponentListener(this);
blocksPane.setComponentPopupMenu(popup);
threadnameFilterTextField = new EnhancedTextField(THREADNAME_FILTER);
threadnameFilterTextField.setToolTipText(THREADNAME_FILTER);
threadnameFilterTextField.setMaximumSize(new Dimension(Integer.MAX_VALUE,20));
threadnameFilterTextField.addActionListener(new AbstractAction() {
@Override
public void actionPerformed(ActionEvent arg0) {
refresh();
selectionChanged();
}
});
add(threadnameFilterTextField, BorderLayout.PAGE_START);
JPanel threadTimelinePane = new JPanel(new BorderLayout());
threadTimelinePane.add(axis, BorderLayout.PAGE_START);
scrollPane = new JScrollPane(blocksPane, ScrollPaneLayout.VERTICAL_SCROLLBAR_ALWAYS, ScrollPaneLayout.HORIZONTAL_SCROLLBAR_NEVER);
scrollPane.setBorder(new EmptyBorder(new Insets(0, 0, 0, 0)));
threadTimelinePane.add(scrollPane, BorderLayout.CENTER);
threadTimelinePane.add(label, BorderLayout.PAGE_END);
add(threadTimelinePane, BorderLayout.CENTER);
refresh();
}
示例7: getMinimumSize
import javax.swing.ScrollPaneLayout; //导入依赖的package包/类
public Dimension getMinimumSize(JComponent c)
{
JScrollPane p = (JScrollPane) c;
ScrollPaneLayout sl = (ScrollPaneLayout) p.getLayout();
return sl.minimumLayoutSize(c);
}
示例8: getMinimumSize
import javax.swing.ScrollPaneLayout; //导入依赖的package包/类
public Dimension getMinimumSize(JComponent c)
{
JScrollPane p = (JScrollPane) c;
ScrollPaneLayout sl = (ScrollPaneLayout) p.getLayout();
return sl.minimumLayoutSize(c);
}
示例9: createViewComponents
import javax.swing.ScrollPaneLayout; //导入依赖的package包/类
protected void createViewComponents() {
contentPanel.setLayout(new BorderLayout());
popup = new TreePopupMenu(this);
graph = new GraphPane();
graph.setPreferredSize(new Dimension(5000,0));
graph.addMouseListener(this);
graph.addMouseMotionListener(this);
graph.setComponentPopupMenu(popup);
scrollPane = new JScrollPane(graph, ScrollPaneLayout.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneLayout.HORIZONTAL_SCROLLBAR_ALWAYS);
scrollPane.getHorizontalScrollBar().addAdjustmentListener(this);
contentPanel.add(scrollPane,BorderLayout.CENTER);
JPanel legendPane = new JPanel(new BorderLayout());
methodTextArea = new JTextArea();
methodTextArea.setMaximumSize(new Dimension(Integer.MAX_VALUE, 25));
legendPane.add(methodTextArea, BorderLayout.PAGE_START);
legend = new FrameworkLegendPane(blockColorer);
legend.setMaximumSize(new Dimension(Integer.MAX_VALUE, 40));
legend.setPreferredSize(new Dimension(Integer.MAX_VALUE, 40));
legendPane.add(legend, BorderLayout.CENTER);
contentPanel.add(legendPane, BorderLayout.PAGE_END);
}