View Javadoc

1   package org.xnap.commons.gui;
2   
3   import java.awt.BorderLayout;
4   import java.awt.Color;
5   import java.awt.Font;
6   import javax.swing.JLabel;
7   import javax.swing.JPanel;
8   import javax.swing.JSeparator;
9   
10  public class TitledSeparator extends JPanel {
11      
12      public TitledSeparator(String title, int alignment) {
13      	// TODO rewrite this
14      	setLayout(new BorderLayout());
15      	add(new JSeparator(), BorderLayout.CENTER);
16      	JLabel label = new JLabel(title);
17      	label.setFont(new Font("Dialog", Font.BOLD, 14));
18      	label.setForeground(Color.blue);
19      	add(label, BorderLayout.EAST);
20      }
21  
22  }