本文整理汇总了Java中javax.swing.ScrollPaneConstants类的典型用法代码示例。如果您正苦于以下问题:Java ScrollPaneConstants类的具体用法?Java ScrollPaneConstants怎么用?Java ScrollPaneConstants使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ScrollPaneConstants类属于javax.swing包,在下文中一共展示了ScrollPaneConstants类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initComponents
import javax.swing.ScrollPaneConstants; //导入依赖的package包/类
/**
* Set up the panel contents and layout
*/
private void initComponents() {
stTable = new STTable();
JPanel totalBox = new JPanel(new BorderLayout(10, 10));
JLabel descrLabel = new JLabel(jmt.jmva.analytical.ExactConstants.DESCRIPTION_ReferenceStation);
JPanel descrBox = new JPanel(new BorderLayout());
descrBox.setPreferredSize(new Dimension(200, 1000));
descrBox.add(descrLabel, BorderLayout.NORTH);
JScrollPane visitTablePane = new JScrollPane(stTable);
visitTablePane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED);
visitTablePane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
totalBox.add(visitTablePane, BorderLayout.CENTER);
totalBox.add(descrBox, BorderLayout.WEST);
setLayout(new BorderLayout());
add(totalBox, BorderLayout.CENTER);
add(Box.createVerticalStrut(30), BorderLayout.NORTH);
add(Box.createVerticalStrut(30), BorderLayout.SOUTH);
add(Box.createHorizontalStrut(20), BorderLayout.EAST);
add(Box.createHorizontalStrut(20), BorderLayout.WEST);
}
示例2: setScrollBarVisibility
import javax.swing.ScrollPaneConstants; //导入依赖的package包/类
private void setScrollBarVisibility(final int visibility) {
final ScrollableJTextArea pane = getDelegate();
final JTextArea view = pane.getView();
view.setLineWrap(false);
switch (visibility) {
case TextArea.SCROLLBARS_NONE:
pane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
pane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER);
view.setLineWrap(true);
break;
case TextArea.SCROLLBARS_VERTICAL_ONLY:
pane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
pane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
view.setLineWrap(true);
break;
case TextArea.SCROLLBARS_HORIZONTAL_ONLY:
pane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER);
pane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS);
break;
default:
pane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS);
pane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
break;
}
}
示例3: initComponents
import javax.swing.ScrollPaneConstants; //导入依赖的package包/类
private void initComponents() {
Box vBox = Box.createVerticalBox();
Box hBox = Box.createHorizontalBox();
synView = new JTextPane();
synView.setContentType("text/html");
synView.setEditable(false);
synScroll = new JScrollPane(synView);
synScroll.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
synScroll.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED);
vBox.add(Box.createVerticalStrut(20));
vBox.add(hBox);
vBox.add(Box.createVerticalStrut(20));
hBox.add(Box.createHorizontalStrut(20));
hBox.add(synScroll);
hBox.add(Box.createHorizontalStrut(20));
this.setLayout(new GridLayout(1, 1));
this.add(vBox);
synView
.setText("<html><body><center><font face=\"bold\" size=\"3\">Saturation Sectors will be here displayed once you solve the model.</font></center></body></html>");
}
示例4: getMinimumSize
import javax.swing.ScrollPaneConstants; //导入依赖的package包/类
@Override
public Dimension getMinimumSize(final int rows, final int columns) {
final Dimension size = super.getMinimumSize(rows, columns);
synchronized (getDelegateLock()) {
// JScrollPane insets
final Insets pi = getDelegate().getInsets();
size.width += pi.left + pi.right;
size.height += pi.top + pi.bottom;
// Take scrollbars into account.
final int vsbPolicy = getDelegate().getVerticalScrollBarPolicy();
if (vsbPolicy == ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS) {
final JScrollBar vbar = getDelegate().getVerticalScrollBar();
size.width += vbar != null ? vbar.getMinimumSize().width : 0;
}
final int hsbPolicy = getDelegate().getHorizontalScrollBarPolicy();
if (hsbPolicy == ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS) {
final JScrollBar hbar = getDelegate().getHorizontalScrollBar();
size.height += hbar != null ? hbar.getMinimumSize().height : 0;
}
}
return size;
}
示例5: DockableResultDisplay
import javax.swing.ScrollPaneConstants; //导入依赖的package包/类
public DockableResultDisplay() {
this.dockKey.setDockGroup(MainFrame.DOCK_GROUP_RESULTS);
DockableActionCustomizer customizer = new DockableActionCustomizer() {
@Override
public void visitTabSelectorPopUp(JPopupMenu popUpMenu, Dockable dockable) {
popUpMenu.add(new JMenuItem(new CloseAllResultsAction(RapidMinerGUI.getMainFrame())));
}
};
customizer.setTabSelectorPopUpCustomizer(true); // enable tabbed dock custom popup menu
// entries
this.dockKey.setActionCustomizer(customizer);
setLayout(new BorderLayout());
ExtendedJScrollPane overviewScrollpane = new ExtendedJScrollPane(overview);
overviewScrollpane.setBorder(null);
overviewScrollpane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
overviewScrollpane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
add(overviewScrollpane, BorderLayout.CENTER);
tableUpdateQueue.start();
}
示例6: RemoteResultDisplay
import javax.swing.ScrollPaneConstants; //导入依赖的package包/类
public RemoteResultDisplay() {
this.dockKey.setDockGroup(MainFrame.DOCK_GROUP_RESULTS);
DockableActionCustomizer customizer = new DockableActionCustomizer() {
@Override
public void visitTabSelectorPopUp(JPopupMenu popUpMenu, Dockable dockable) {
popUpMenu.add(new JMenuItem(new CloseAllResultsAction(RapidMinerGUI.getMainFrame())));
}
};
customizer.setTabSelectorPopUpCustomizer(true); // enable tabbed dock custom popup menu
// entries
this.dockKey.setActionCustomizer(customizer);
setLayout(new BorderLayout());
ExtendedJScrollPane overviewScrollpane = new ExtendedJScrollPane(overview);
overviewScrollpane.setBorder(null);
overviewScrollpane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
overviewScrollpane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
add(overviewScrollpane, BorderLayout.CENTER);
tableUpdateQueue.start();
}
示例7: initComponents
import javax.swing.ScrollPaneConstants; //导入依赖的package包/类
/**
* Set up the panel contents and layout
*/
protected void initComponents() {
table = new ResultsTable(getTableModel(), help);
table.setRowHeight(CommonConstants.ROW_HEIGHT);
statusLabel.setForeground(Color.RED);
statusLabel.setFont(new Font("Arial", Font.BOLD, 14));
statusLabel.setText("WARNING: parameters have been changed since this solution was computed!");
statusLabel.setHorizontalAlignment(SwingConstants.CENTER);
help.addHelp(statusLabel, "This solution is not current with the parameters of the model. Click solve to compute a new solution.");
JPanel intPanel = new JPanel(new BorderLayout(10, 10));
JScrollPane jsp = new JScrollPane(table, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
JLabel descrLabel = new JLabel(getDescriptionMessage());
intPanel.add(descrLabel, BorderLayout.NORTH);
intPanel.add(jsp, BorderLayout.CENTER);
setLayout(new BorderLayout());
add(intPanel, BorderLayout.CENTER);
setBorder(BorderFactory.createEmptyBorder(20, 20, 20, 20));
}
示例8: initComponents
import javax.swing.ScrollPaneConstants; //导入依赖的package包/类
private void initComponents() {
Box vBox = Box.createVerticalBox();
Box hBox = Box.createHorizontalBox();
synView = new JTextPane();
synView.setContentType("text/html");
synView.setEditable(false);
synScroll = new JScrollPane(synView);
synScroll.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
synScroll.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED);
vBox.add(Box.createVerticalStrut(30));
vBox.add(hBox);
vBox.add(Box.createVerticalStrut(30));
hBox.add(Box.createHorizontalStrut(20));
hBox.add(synScroll);
hBox.add(Box.createHorizontalStrut(20));
this.setLayout(new GridLayout(1, 1));
this.add(vBox);
}
示例9: initComponents
import javax.swing.ScrollPaneConstants; //导入依赖的package包/类
private void initComponents() {
Box vBox = Box.createVerticalBox();
Box hBox = Box.createHorizontalBox();
synView = new JTextPane();
synView.setContentType("text/html");
synView.setEditable(false);
synScroll = new JScrollPane(synView);
synScroll.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
synScroll.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED);
vBox.add(Box.createVerticalStrut(30));
vBox.add(hBox);
vBox.add(Box.createVerticalStrut(30));
hBox.add(Box.createHorizontalStrut(20));
hBox.add(synScroll);
hBox.add(Box.createHorizontalStrut(20));
this.setLayout(new GridLayout(1, 1));
this.add(vBox);
synView
.setText("<html><body><center><font face=\"bold\" size=\"3\">Saturation Sectors will be here displayed once you solve the model.</font></center></body></html>");
}
示例10: installLabels
import javax.swing.ScrollPaneConstants; //导入依赖的package包/类
private void installLabels(JScrollPane scrollPane) {
moreColumnsLabel.setIcon(JMTImageLoader.loadImage("table_rightarrow"));
moreColumnsLabel.setHorizontalAlignment(SwingConstants.CENTER);
moreColumnsLabel.setToolTipText(moreColumnsTooltip);
moreColumnsLabel.setVisible(false);
moreRowsLabel.setIcon(JMTImageLoader.loadImage("table_downarrow"));
moreRowsLabel.setHorizontalAlignment(SwingConstants.CENTER);
moreRowsLabel.setToolTipText(moreRowsTooltip);
moreRowsLabel.setVisible(false);
scrollPane.setCorner(ScrollPaneConstants.UPPER_RIGHT_CORNER, moreColumnsLabel);
scrollPane.setCorner(ScrollPaneConstants.LOWER_LEFT_CORNER, moreRowsLabel);
if (displaysScrollLabels) {
updateScrollLabels();
}
}
示例11: setEnabled
import javax.swing.ScrollPaneConstants; //导入依赖的package包/类
@Override
public void setEnabled(boolean enabled) {
fromLabel.setEnabled(enabled);
from.setEnabled(enabled);
toLabel.setEnabled(enabled);
to.setEnabled(enabled);
stepsLabel.setEnabled(enabled);
steps.setEnabled(enabled);
classChooserLabel.setEnabled(enabled);
classChooser.setEnabled(enabled);
description.setEnabled(enabled);
if (!enabled) {
scroll.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER);
descrPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER);
} else {
scroll.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED);
descrPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED);
}
if (!enabled) {
title.setTitleColor(Color.LIGHT_GRAY);
descriptionTitle.setTitleColor(Color.LIGHT_GRAY);
} else {
title.setTitleColor(DEFAULT_TITLE_COLOR);
descriptionTitle.setTitleColor(DEFAULT_TITLE_COLOR);
}
}
示例12: initComponents
import javax.swing.ScrollPaneConstants; //导入依赖的package包/类
/**
* Set up the panel contents and layout
*/
protected void initComponents() {
table = new ResultsTable(getTableModel(), help);
statusLabel.setForeground(Color.red);
statusLabel.setFont(new Font("Arial", Font.BOLD, 14));
statusLabel.setText("WARNING: parameters have been changed since this solution was computed!");
statusLabel.setHorizontalAlignment(SwingConstants.CENTER);
help.addHelp(statusLabel, "This solution is not current with the parameters of the model. Click solve to compute a new solution.");
JPanel intPanel = new JPanel(new BorderLayout(10, 10));
JScrollPane jsp = new JScrollPane(table, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
JLabel descrLabel = new JLabel(getDescriptionMessage());
intPanel.add(descrLabel, BorderLayout.NORTH);
intPanel.add(jsp, BorderLayout.CENTER);
setLayout(new BorderLayout());
add(intPanel, BorderLayout.CENTER);
setBorder(BorderFactory.createEmptyBorder(20, 20, 20, 20));
}
示例13: LicenceJMenuItem
import javax.swing.ScrollPaneConstants; //导入依赖的package包/类
/**
* Constructs
*
* @param objPcontrolJFrame
*/
public LicenceJMenuItem(ControlJFrame objPcontrolJFrame) {
this.objGcontrolJFrame = objPcontrolJFrame;
// Licence dialog :
this.objGlicenceJDialog = new JDialog(this.objGcontrolJFrame, this.objGcontrolJFrame.getLanguageString(Language.intS_TITLE_LICENCE), true);
final JTextArea objLlicenceJTextArea = new JTextArea();
objLlicenceJTextArea.setFont(new Font("Courier", Font.PLAIN, 11));
objLlicenceJTextArea.setOpaque(true);
objLlicenceJTextArea.setEditable(false);
final JScrollPane objLjScrollPane =
new JScrollPane(objLlicenceJTextArea,
ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED,
ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
objLjScrollPane.setOpaque(true);
this.objGlicenceJDialog.add(objLjScrollPane);
this.objGlicenceJDialog.validate();
this.objGlicenceJDialog.pack();
this.objGlicenceJDialog.addWindowListener(new JDialogWindowListener(this.objGcontrolJFrame, this.objGlicenceJDialog, false));
this.setFont(this.objGcontrolJFrame.getFont());
this.setOpaque(true);
this.addActionListener(this);
this.setAccelerator(Constants.keyS_LICENCE);
}
示例14: initComponents
import javax.swing.ScrollPaneConstants; //导入依赖的package包/类
private void initComponents() {
Box vBox = Box.createVerticalBox();
Box hBox = Box.createHorizontalBox();
synView = new JTextPane();
synView.setContentType("text/html");
synView.setEditable(false);
synScroll = new JScrollPane(synView);
synScroll.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
synScroll.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED);
vBox.add(Box.createVerticalStrut(20));
vBox.add(hBox);
vBox.add(Box.createVerticalStrut(20));
hBox.add(Box.createHorizontalStrut(20));
hBox.add(synScroll);
hBox.add(Box.createHorizontalStrut(20));
this.setLayout(new GridLayout(1, 1));
this.add(vBox);
}
示例15: installLabels
import javax.swing.ScrollPaneConstants; //导入依赖的package包/类
private void installLabels(JScrollPane scrollPane) {
moreColumnsLabel.setIcon(JMTImageLoader.loadImage("table_rightarrow"));
moreColumnsLabel.setHorizontalAlignment(SwingConstants.CENTER);
moreColumnsLabel.setToolTipText(moreColumnsTooltip);
moreColumnsLabel.setVisible(false);
moreRowsLabel.setIcon(JMTImageLoader.loadImage("table_downarrow"));
moreRowsLabel.setHorizontalAlignment(SwingConstants.CENTER);
moreRowsLabel.setToolTipText(moreRowsTooltip);
moreRowsLabel.setVisible(false);
scrollPane.setCorner(ScrollPaneConstants.UPPER_RIGHT_CORNER, moreColumnsLabel);
scrollPane.setCorner(ScrollPaneConstants.LOWER_LEFT_CORNER, moreRowsLabel);
if (displaysScrollLabels) {
updateScrollLabels();
}
}