javax.swing.JSeparator#setAlignmentY ( )源码实例Demo

下面列出了javax.swing.JSeparator#setAlignmentY ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: jdal   文件: SeparatorTitled.java
public SeparatorTitled(String title, boolean bold) {

	super(BoxLayout.LINE_AXIS);
	JLabel titleLabel = new JLabel(title);
	
	if (bold)
		FormUtils.setBold(titleLabel);
	
	titleLabel.setAlignmentY(Component.BOTTOM_ALIGNMENT);
	this.add(titleLabel);
	this.add(Box.createHorizontalStrut(5));
	JSeparator separator = new JSeparator();
	separator.setAlignmentY(Container.TOP_ALIGNMENT);
	this.add(separator);
	this.setMaximumSize(new Dimension(Short.MAX_VALUE, 20));
}
 
源代码2 项目: jdal   文件: TitledSeparator.java
private void build(String title) {

	JLabel titleLabel = new JLabel(title);
	
	if (color != null) 
		titleLabel.setForeground(color);
	
	titleLabel.setFont(font);
	
	titleLabel.setAlignmentY(Component.BOTTOM_ALIGNMENT);
	this.add(titleLabel);
	this.add(Box.createHorizontalStrut(5));
	JSeparator separator = new JSeparator();
	separator.setAlignmentY(Container.TOP_ALIGNMENT);
	this.add(separator);
	this.setMaximumSize(new Dimension(Short.MAX_VALUE, 20));
}
 
源代码3 项目: pentaho-reporting   文件: ParameterDialog.java
private Box createPromptPanel() {
  final Box pane = Box.createHorizontalBox();
  pane.setBorder( BorderFactory.createEmptyBorder( 15, 0, 10, 0 ) );

  final JLabel promptLabel = new JLabel( Messages.getString( "ParameterDialog.Prompt" ) );
  pane.add( promptLabel );

  pane.add( Box.createRigidArea( new Dimension( 10, 0 ) ) );

  final JSeparator horizontalSeparator = new JSeparator();
  horizontalSeparator.setAlignmentY( TOP_ALIGNMENT );
  pane.add( horizontalSeparator );

  return pane;
}