當前位置: 首頁>>代碼示例>>Java>>正文


Java ScrollPaneConstants類代碼示例

本文整理匯總了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);	
}
 
開發者ID:max6cn,項目名稱:jmt,代碼行數:26,代碼來源:ReferenceStationPanel.java

示例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;
    }
}
 
開發者ID:SunburstApps,項目名稱:OpenJSharp,代碼行數:27,代碼來源:LWTextAreaPeer.java

示例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>");
}
 
開發者ID:HOMlab,項目名稱:QN-ACTR-Release,代碼行數:21,代碼來源:SectorsTextualPanel.java

示例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;
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:23,代碼來源:LWTextAreaPeer.java

示例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();
}
 
開發者ID:transwarpio,項目名稱:rapidminer,代碼行數:21,代碼來源:DockableResultDisplay.java

示例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();
}
 
開發者ID:transwarpio,項目名稱:rapidminer,代碼行數:21,代碼來源:RemoteResultDisplay.java

示例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));

}
 
開發者ID:max6cn,項目名稱:jmt,代碼行數:26,代碼來源:SolutionPanel.java

示例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);
}
 
開發者ID:max6cn,項目名稱:jmt,代碼行數:19,代碼來源:SynopsisPanel.java

示例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>");
}
 
開發者ID:max6cn,項目名稱:jmt,代碼行數:21,代碼來源:SectorsTextualPanel.java

示例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();
	}
}
 
開發者ID:max6cn,項目名稱:jmt,代碼行數:19,代碼來源:ExactTable.java

示例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);
	}
}
 
開發者ID:max6cn,項目名稱:jmt,代碼行數:27,代碼來源:PopulationMixPanel.java

示例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));

}
 
開發者ID:HOMlab,項目名稱:QN-ACTR-Release,代碼行數:26,代碼來源:SolutionPanel.java

示例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);
}
 
開發者ID:jugglemaster,項目名稱:JuggleMasterPro,代碼行數:30,代碼來源:LicenceJMenuItem.java

示例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);
}
 
開發者ID:HOMlab,項目名稱:QN-ACTR-Release,代碼行數:19,代碼來源:SynopsisPanel.java

示例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();
	}

}
 
開發者ID:HOMlab,項目名稱:QN-ACTR-Release,代碼行數:20,代碼來源:ExactTable.java


注:本文中的javax.swing.ScrollPaneConstants類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。