FileDocCategorySizeDatePackage
TitledExample.javaAPI DocExample746Mon Nov 09 12:45:48 GMT 1998None

TitledExample

public class TitledExample extends JPanel

Fields Summary
Constructors Summary
public TitledExample()

        super(true);

        this.setLayout(new GridLayout(1, 1, 5, 5));

        JLabel label = new JLabel("Titled Border");
        label.setHorizontalAlignment(JLabel.CENTER);

        TitledBorder titled = new TitledBorder("Title");
        label.setBorder(titled);

        add(label);
    
Methods Summary
public static voidmain(java.lang.String[] s)

         JFrame frame = new JFrame("Borders");
         frame.addWindowListener(new BasicWindowMonitor());
         frame.setSize(200, 100);
         frame.setContentPane(new TitledExample());
         frame.setVisible(true);