package com.onaro.util.jfc; import javax.swing.*; import java.awt.*; /** * Adds a label to a {@link JSeparator}. */ public class SeparatorAndLabel extends JPanel { private static final long serialVersionUID = 1L; /** * The label. */ private JLabel label = new JLabel(); /** * Initializes this separator and the label's text. * @param labelText the text of the label */ public SeparatorAndLabel(String labelText) { super(new BorderLayout()); setText(labelText); add(label, BorderLayout.WEST); add(new JSeparator(), BorderLayout.CENTER); } /** * Sets the label's text. * @param text the new label */ public void setText(String text) { label.setText(text); } }