当前位置: 首页>>代码示例>>Java>>正文


Java ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER属性代码示例

本文整理汇总了Java中javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER属性的典型用法代码示例。如果您正苦于以下问题:Java ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER属性的具体用法?Java ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER怎么用?Java ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在javax.swing.ScrollPaneConstants的用法示例。


在下文中一共展示了ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER属性的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: initComponents

/**
 * 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,代码行数:25,代码来源:SolutionPanel.java

示例2: initComponents

/**
 * 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,代码行数:25,代码来源:SolutionPanel.java

示例3: initComponents

/**
 * Set up the panel contents and layout
 */
private void initComponents() {
	textPane = new JTextPane();
	help.addHelp(textPane, "Enter any text describing this model");

	//BEGIN Federico Dall'Orso 14/3/2005
	//OLD
	/*
	setLayout(new BorderLayout());
	JScrollPane esp = new JScrollPane(textPane);
	esp.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
	add(esp, BorderLayout.CENTER);
	add(Box.createVerticalStrut(30), BorderLayout.NORTH);
	add(Box.createHorizontalStrut(20), BorderLayout.EAST);
	add(Box.createVerticalStrut(30), BorderLayout.SOUTH);
	add(Box.createHorizontalStrut(20), BorderLayout.WEST);
	*/
	//NEW
	JPanel intPanel = new JPanel(new BorderLayout(10, 10));
	//Box intPanel = Box.createVerticalBox();

	JScrollPane jsp = new JScrollPane(textPane, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
	JLabel descrLabel = new JLabel(DESCRIPTION_COMMENT);

	intPanel.add(descrLabel, BorderLayout.NORTH);
	intPanel.add(jsp, BorderLayout.CENTER);
	//intPanel.add(jsp);

	setLayout(new BorderLayout());
	add(intPanel, 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);

	//END Federico Dall'Orso 14/3/2005

}
 
开发者ID:max6cn,项目名称:jmt,代码行数:40,代码来源:DescriptionPanel.java

示例4: QuickHTMLViewer

/**creates a new instance of this viewer, given the document's url, and sets up
 * visualization.
 * @param url: url of document that must be displayed.
 */
public QuickHTMLViewer(URL url) {
	this.centerWindow(CommonConstants.MAX_GUI_WIDTH_QUICKHTML, CommonConstants.MAX_GUI_HEIGHT_QUICKHTML);
	HtmlPanel html = new HtmlPanel(url);
	html.setAntiAliasing(true);
	JScrollPane jsp = new JScrollPane(html, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
	this.getContentPane().add(jsp);
}
 
开发者ID:max6cn,项目名称:jmt,代码行数:11,代码来源:QuickHTMLViewer.java

示例5: initComponents

/**
 * Set up the panel contents and layout
 */
private void initComponents() {
	textPane = new JTextPane();
	help.addHelp(textPane, "Enter any text describing this model");

	//BEGIN Federico Dall'Orso 14/3/2005
	//OLD
	/*
	setLayout(new BorderLayout());
	JScrollPane esp = new JScrollPane(textPane);
	esp.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
	add(esp, BorderLayout.CENTER);
	add(Box.createVerticalStrut(20), BorderLayout.NORTH);
	add(Box.createHorizontalStrut(20), BorderLayout.EAST);
	add(Box.createVerticalStrut(20), BorderLayout.SOUTH);
	add(Box.createHorizontalStrut(20), BorderLayout.WEST);
	*/
	//NEW
	JPanel intPanel = new JPanel(new BorderLayout(10, 10));
	//Box intPanel = Box.createVerticalBox();

	JScrollPane jsp = new JScrollPane(textPane, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
	JLabel descrLabel = new JLabel(DESCRIPTION_COMMENT);

	intPanel.add(descrLabel, BorderLayout.NORTH);
	intPanel.add(jsp, BorderLayout.CENTER);
	//intPanel.add(jsp);

	setLayout(new BorderLayout());
	add(intPanel, BorderLayout.CENTER);
	add(Box.createVerticalStrut(20), BorderLayout.NORTH);
	add(Box.createVerticalStrut(20), BorderLayout.SOUTH);
	add(Box.createHorizontalStrut(20), BorderLayout.EAST);
	add(Box.createHorizontalStrut(20), BorderLayout.WEST);

	//END Federico Dall'Orso 14/3/2005

}
 
开发者ID:HOMlab,项目名称:QN-ACTR-Release,代码行数:40,代码来源:DescriptionPanel.java

示例6: QuickHTMLViewer

/**creates a new instance of this viewer, given the document's url, and sets up
 * visualization.
 * @param url: url of document that must be displayed.
 */
public QuickHTMLViewer(URL url) {
	this.centerWindow(640, 480);
	HtmlPanel html = new HtmlPanel(url);
	html.setAntiAliasing(true);
	JScrollPane jsp = new JScrollPane(html, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
	this.getContentPane().add(jsp);
}
 
开发者ID:HOMlab,项目名称:QN-ACTR-Release,代码行数:11,代码来源:QuickHTMLViewer.java

示例7: ExpressionTab

public ExpressionTab(AnalyzerModel model) {
	this.model = model;
	selector = new OutputSelector(model);

	model.getOutputExpressions().addOutputExpressionsListener(myListener);
	selector.addItemListener(myListener);
	clear.addActionListener(myListener);
	revert.addActionListener(myListener);
	enter.addActionListener(myListener);
	field.setLineWrap(true);
	field.setWrapStyleWord(true);
	field.getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), myListener);
	field.getDocument().addDocumentListener(myListener);
	field.setFont(new Font("sans serif", Font.PLAIN, 14));

	JPanel buttons = new JPanel();
	buttons.add(clear);
	buttons.add(revert);
	buttons.add(enter);

	GridBagLayout gb = new GridBagLayout();
	GridBagConstraints gc = new GridBagConstraints();
	setLayout(gb);
	gc.weightx = 1.0;
	gc.gridx = 0;
	gc.gridy = GridBagConstraints.RELATIVE;
	gc.fill = GridBagConstraints.BOTH;

	JPanel selectorPanel = selector.createPanel();
	gb.setConstraints(selectorPanel, gc);
	add(selectorPanel);
	gb.setConstraints(prettyView, gc);
	add(prettyView);
	gc.insets = new Insets(10, 10, 0, 10);
	JScrollPane fieldPane = new JScrollPane(field, ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS,
			ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
	gb.setConstraints(fieldPane, gc);
	add(fieldPane);
	gb.setConstraints(buttons, gc);
	add(buttons);
	gc.fill = GridBagConstraints.BOTH;
	gb.setConstraints(error, gc);
	add(error);

	myListener.insertUpdate(null);
	setError(null);
}
 
开发者ID:LogisimIt,项目名称:Logisim,代码行数:47,代码来源:ExpressionTab.java

示例8: VariableTab

VariableTab(VariableList data) {
	this.data = data;

	list.setModel(new VariableListModel(data));
	list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
	list.addListSelectionListener(myListener);
	remove.addActionListener(myListener);
	moveUp.addActionListener(myListener);
	moveDown.addActionListener(myListener);
	add.addActionListener(myListener);
	rename.addActionListener(myListener);
	field.addActionListener(myListener);
	field.getDocument().addDocumentListener(myListener);

	JScrollPane listPane = new JScrollPane(list, ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS,
			ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
	listPane.setPreferredSize(new Dimension(100, 100));

	JPanel topPanel = new JPanel(new GridLayout(3, 1));
	topPanel.add(remove);
	topPanel.add(moveUp);
	topPanel.add(moveDown);

	JPanel fieldPanel = new JPanel();
	fieldPanel.add(rename);
	fieldPanel.add(add);

	GridBagLayout gb = new GridBagLayout();
	GridBagConstraints gc = new GridBagConstraints();
	setLayout(gb);

	gc.insets = new Insets(10, 10, 0, 10);
	gc.fill = GridBagConstraints.BOTH;
	gc.weightx = 1.0;
	gb.setConstraints(listPane, gc);
	add(listPane);

	gc.fill = GridBagConstraints.NONE;
	gc.anchor = GridBagConstraints.PAGE_START;
	gc.weightx = 0.0;
	gb.setConstraints(topPanel, gc);
	add(topPanel);

	gc.gridwidth = GridBagConstraints.REMAINDER;
	gc.gridx = 0;
	gc.gridy = GridBagConstraints.RELATIVE;
	gc.fill = GridBagConstraints.HORIZONTAL;
	gb.setConstraints(field, gc);
	field.setBorder(BorderFactory.createLineBorder(new Color(130, 135, 144)));
	add(field);

	gb.setConstraints(fieldPanel, gc);
	add(fieldPanel);

	gc.fill = GridBagConstraints.HORIZONTAL;
	gb.setConstraints(error, gc);
	add(error);

	if (!data.isEmpty())
		list.setSelectedValue(data.get(0), true);
	computeEnabled();
}
 
开发者ID:LogisimIt,项目名称:Logisim,代码行数:62,代码来源:VariableTab.java

示例9: HexFrame

public HexFrame(Project proj, HexModel model) {
	setDefaultCloseOperation(HIDE_ON_CLOSE);

	LogisimMenuBar menubar = new LogisimMenuBar(this, proj);
	setJMenuBar(menubar);

	this.model = model;
	this.editor = new HexEditor(model);

	JPanel buttonPanel = new JPanel();
	buttonPanel.add(open);
	buttonPanel.add(save);
	buttonPanel.add(close);
	open.addActionListener(myListener);
	save.addActionListener(myListener);
	close.addActionListener(myListener);

	Dimension pref = editor.getPreferredSize();
	JScrollPane scroll = new JScrollPane(editor, ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS,
			ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
	pref.height = Math.min(pref.height, pref.width * 3 / 2);
	scroll.setPreferredSize(pref);
	scroll.getViewport().setBackground(editor.getBackground());

	Container contents = getContentPane();
	contents.add(scroll, BorderLayout.CENTER);
	contents.add(buttonPanel, BorderLayout.SOUTH);

	LocaleManager.addLocaleListener(myListener);
	myListener.localeChanged();
	pack();

	setLocationRelativeTo(null);

	Dimension size = getSize();
	Dimension screen = getToolkit().getScreenSize();
	if (size.width > screen.width || size.height > screen.height) {
		size.width = Math.min(size.width, screen.width);
		size.height = Math.min(size.height, screen.height);
		setSize(size);
	}

	editor.getCaret().addChangeListener(editListener);
	editor.getCaret().setDot(0, false);
	editListener.register(menubar);
}
 
开发者ID:LogisimIt,项目名称:Logisim,代码行数:46,代码来源:HexFrame.java


注:本文中的javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。