Java Code Examples for javax.swing.JSeparator#setAlignmentY()
The following examples show how to use
javax.swing.JSeparator#setAlignmentY() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SeparatorTitled.java From jdal with Apache License 2.0 | 6 votes |
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)); }
Example 2
Source File: TitledSeparator.java From jdal with Apache License 2.0 | 6 votes |
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)); }
Example 3
Source File: ParameterDialog.java From pentaho-reporting with GNU Lesser General Public License v2.1 | 5 votes |
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; }