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


Java Box.setPreferredSize方法代码示例

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


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

示例1: initComponents

import javax.swing.Box; //导入方法依赖的package包/类
/**
 * Set up the panel contents and layout
 */
private void initComponents() {

	stTable = new STTable();

	/* and now some Box black magic */

	Box hBox = Box.createHorizontalBox();
	hBox.add(Box.createHorizontalStrut(20));
	//Horizontal box containing Description label and buttons
	Box descrBox = Box.createVerticalBox();
	descrBox.add(new JLabel(DESCRIPTION_SERVICEDEMANDS));
	descrBox.add(Box.createHorizontalStrut(10));
	descrBox.add(new JButton(SWITCH_TO_ST_V));
	descrBox.setPreferredSize(new Dimension(220, 1000));
	descrBox.setMinimumSize(new Dimension(200, 200));

	hBox.add(descrBox);
	hBox.add(Box.createHorizontalStrut(10));
	JScrollPane visitTablePane = new JScrollPane(stTable);
	visitTablePane.setPreferredSize(new Dimension(1000, 1000));
	visitTablePane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED);
	visitTablePane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
	hBox.add(visitTablePane);
	hBox.add(Box.createHorizontalStrut(20));

	Box totalBox = Box.createVerticalBox();
	totalBox.add(Box.createVerticalStrut(30));
	totalBox.add(hBox);
	totalBox.add(Box.createVerticalStrut(30));

	setLayout(new BorderLayout());
	add(totalBox, BorderLayout.CENTER);

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

示例2: initComponents

import javax.swing.Box; //导入方法依赖的package包/类
/**
 * Set up the panel contents and layout
 */
private void initComponents() {

	stTable = new STTable();

	Box hBox = Box.createHorizontalBox();
	hBox.add(Box.createHorizontalStrut(20));
	//Horizontal box containing Description label and buttons
	Box descrBox = Box.createVerticalBox();
	descrBox.add(new JLabel(DESCRIPTION_SERVICETIMES));
	descrBox.add(Box.createHorizontalStrut(10));
	descrBox.add(new JButton(SWITCH_TO_SD));
	descrBox.setPreferredSize(new Dimension(220, 1000));
	descrBox.setMinimumSize(new Dimension(200, 200));

	hBox.add(descrBox);
	hBox.add(Box.createHorizontalStrut(10));
	JScrollPane visitTablePane = new JScrollPane(stTable);
	visitTablePane.setPreferredSize(new Dimension(1000, 1000));
	visitTablePane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED);
	visitTablePane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
	hBox.add(visitTablePane);
	hBox.add(Box.createHorizontalStrut(20));

	Box totalBox = Box.createVerticalBox();
	totalBox.add(Box.createVerticalStrut(30));
	totalBox.add(hBox);
	totalBox.add(Box.createVerticalStrut(30));

	setLayout(new BorderLayout());
	add(totalBox, BorderLayout.CENTER);

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

示例3: initComponents

import javax.swing.Box; //导入方法依赖的package包/类
/**
 * Set up the panel contents and layout
 */
private void initComponents() {

	stTable = new STTable();

	/* and now some Box black magic */

	Box hBox = Box.createHorizontalBox();
	hBox.add(Box.createHorizontalStrut(20));
	//Horizontal box containing Description label and buttons
	Box descrBox = Box.createVerticalBox();
	descrBox.add(new JLabel(DESCRIPTION_SERVICEDEMANDS));
	descrBox.add(Box.createHorizontalStrut(10));
	descrBox.add(new JButton(SWITCH_TO_ST_V));
	descrBox.setPreferredSize(new Dimension(220, 1000));
	descrBox.setMinimumSize(new Dimension(200, 200));

	hBox.add(descrBox);
	hBox.add(Box.createHorizontalStrut(10));
	JScrollPane visitTablePane = new JScrollPane(stTable);
	visitTablePane.setPreferredSize(new Dimension(1000, 1000));
	visitTablePane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED);
	visitTablePane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
	hBox.add(visitTablePane);
	hBox.add(Box.createHorizontalStrut(20));

	Box totalBox = Box.createVerticalBox();
	totalBox.add(Box.createVerticalStrut(20));
	totalBox.add(hBox);
	totalBox.add(Box.createVerticalStrut(20));

	setLayout(new BorderLayout());
	add(totalBox, BorderLayout.CENTER);

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

示例4: initComponents

import javax.swing.Box; //导入方法依赖的package包/类
/**
 * Set up the panel contents and layout
 */
private void initComponents() {

	stTable = new STTable();

	Box hBox = Box.createHorizontalBox();
	hBox.add(Box.createHorizontalStrut(20));
	//Horizontal box containing Description label and buttons
	Box descrBox = Box.createVerticalBox();
	descrBox.add(new JLabel(DESCRIPTION_SERVICETIMES));
	descrBox.add(Box.createHorizontalStrut(10));
	descrBox.add(new JButton(SWITCH_TO_SD));
	descrBox.setPreferredSize(new Dimension(220, 1000));
	descrBox.setMinimumSize(new Dimension(200, 200));

	hBox.add(descrBox);
	hBox.add(Box.createHorizontalStrut(10));
	JScrollPane visitTablePane = new JScrollPane(stTable);
	visitTablePane.setPreferredSize(new Dimension(1000, 1000));
	visitTablePane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED);
	visitTablePane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
	hBox.add(visitTablePane);
	hBox.add(Box.createHorizontalStrut(20));

	Box totalBox = Box.createVerticalBox();
	totalBox.add(Box.createVerticalStrut(20));
	totalBox.add(hBox);
	totalBox.add(Box.createVerticalStrut(20));

	setLayout(new BorderLayout());
	add(totalBox, BorderLayout.CENTER);

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

示例5: getPanel

import javax.swing.Box; //导入方法依赖的package包/类
private Box getPanel() {
    Box result = Box.createVerticalBox();
    result.setBorder(new EmptyBorder(BORDER_WIDTH, BORDER_WIDTH, BORDER_WIDTH, BORDER_WIDTH));
    result.add(getLabel());
    result.add(Box.createVerticalGlue());
    result.add(getBar());
    result.setPreferredSize(new Dimension(DIALOG_WIDTH, DIALOG_HEIGHT));
    return result;
}
 
开发者ID:meteoorkip,项目名称:JavaGraph,代码行数:10,代码来源:ProgressBarDialog.java


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