Example usage for javax.swing.border TitledBorder BELOW_BOTTOM

List of usage examples for javax.swing.border TitledBorder BELOW_BOTTOM

Introduction

In this page you can find the example usage for javax.swing.border TitledBorder BELOW_BOTTOM.

Prototype

int BELOW_BOTTOM

To view the source code for javax.swing.border TitledBorder BELOW_BOTTOM.

Click Source Link

Document

Position the title below the border's bottom line.

Usage

From source file:MainClass.java

public static void main(final String args[]) {
    JFrame frame = new JFrame("Positioned Titled Borders");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

    TitledBorder belowBottomBorder = BorderFactory.createTitledBorder("BelowBottom");
    belowBottomBorder.setTitlePosition(TitledBorder.BELOW_BOTTOM);
    JButton belowBottomButton = new JButton();
    belowBottomButton.setBorder(belowBottomBorder);

    Container contentPane = frame.getContentPane();
    contentPane.add(belowBottomButton);/* w  w  w  .j  ava2 s.  c  o m*/
    frame.setSize(300, 200);
    frame.setVisible(true);
}

From source file:ChangingTitleBorderDirection.java

public static void main(String args[]) {
    JFrame frame = new JFrame("Sample Borders");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

    Border lineBorder = new LineBorder(Color.RED, 5);

    Font font = new Font("Serif", Font.ITALIC, 12);
    Border titledBorder = new TitledBorder(lineBorder, "Hello", TitledBorder.LEFT, TitledBorder.BELOW_BOTTOM,
            font, Color.RED);/*from  w w w  .j ava  2s .c  o  m*/

    JLabel aLabel = new JLabel("Bevel");
    aLabel.setBorder(titledBorder);
    aLabel.setHorizontalAlignment(JLabel.CENTER);

    frame.add(aLabel);
    frame.setSize(400, 200);
    frame.setVisible(true);
}

From source file:TitledPostBorder.java

public static void main(String args[]) {
    JFrame frame = new JFrame("Positioned Titled Borders");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    TitledBorder aboveTopBorder = BorderFactory.createTitledBorder("AboveTop");
    aboveTopBorder.setTitlePosition(TitledBorder.ABOVE_TOP);
    JButton aboveTopButton = new JButton();
    aboveTopButton.setBorder(aboveTopBorder);
    TitledBorder topBorder = BorderFactory.createTitledBorder("Top");
    topBorder.setTitlePosition(TitledBorder.TOP);
    JButton topButton = new JButton();
    topButton.setBorder(topBorder);/*from www . j a  v  a2  s.  c o m*/
    TitledBorder belowTopBorder = BorderFactory.createTitledBorder("BelowTop");
    belowTopBorder.setTitlePosition(TitledBorder.BELOW_TOP);
    JButton belowTopButton = new JButton();
    belowTopButton.setBorder(belowTopBorder);
    TitledBorder aboveBottomBorder = BorderFactory.createTitledBorder("AboveBottom");
    aboveBottomBorder.setTitlePosition(TitledBorder.ABOVE_BOTTOM);
    JButton aboveBottomButton = new JButton();
    aboveBottomButton.setBorder(aboveBottomBorder);
    TitledBorder bottomBorder = BorderFactory.createTitledBorder("Bottom");
    bottomBorder.setTitlePosition(TitledBorder.BOTTOM);
    JButton bottomButton = new JButton();
    bottomButton.setBorder(bottomBorder);
    TitledBorder belowBottomBorder = BorderFactory.createTitledBorder("BelowBottom");
    belowBottomBorder.setTitlePosition(TitledBorder.BELOW_BOTTOM);
    JButton belowBottomButton = new JButton();
    belowBottomButton.setBorder(belowBottomBorder);
    Container contentPane = frame.getContentPane();
    contentPane.setLayout(new GridLayout(3, 2));
    contentPane.add(aboveTopButton);
    contentPane.add(aboveBottomButton);
    contentPane.add(topButton);
    contentPane.add(bottomButton);
    contentPane.add(belowTopButton);
    contentPane.add(belowBottomButton);
    frame.setSize(300, 200);
    frame.setVisible(true);
}

From source file:TitledPostBorder.java

public static void main(String args[]) {
    JFrame frame = new JFrame("Positioned Titled Borders");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

    TitledBorder aboveTopBorder = BorderFactory.createTitledBorder("AboveTop");
    aboveTopBorder.setTitlePosition(TitledBorder.ABOVE_TOP);
    JButton aboveTopButton = new JButton();
    aboveTopButton.setBorder(aboveTopBorder);

    TitledBorder topBorder = BorderFactory.createTitledBorder("Top");
    topBorder.setTitlePosition(TitledBorder.TOP);
    JButton topButton = new JButton();
    topButton.setBorder(topBorder);/*from  ww w . java  2 s. c  om*/

    TitledBorder belowTopBorder = BorderFactory.createTitledBorder("BelowTop");
    belowTopBorder.setTitlePosition(TitledBorder.BELOW_TOP);
    JButton belowTopButton = new JButton();
    belowTopButton.setBorder(belowTopBorder);

    TitledBorder aboveBottomBorder = BorderFactory.createTitledBorder("AboveBottom");
    aboveBottomBorder.setTitlePosition(TitledBorder.ABOVE_BOTTOM);
    JButton aboveBottomButton = new JButton();
    aboveBottomButton.setBorder(aboveBottomBorder);

    TitledBorder bottomBorder = BorderFactory.createTitledBorder("Bottom");
    bottomBorder.setTitlePosition(TitledBorder.BOTTOM);
    JButton bottomButton = new JButton();
    bottomButton.setBorder(bottomBorder);

    TitledBorder belowBottomBorder = BorderFactory.createTitledBorder("BelowBottom");
    belowBottomBorder.setTitlePosition(TitledBorder.BELOW_BOTTOM);
    JButton belowBottomButton = new JButton();
    belowBottomButton.setBorder(belowBottomBorder);

    Container contentPane = frame.getContentPane();
    contentPane.setLayout(new GridLayout(3, 2));
    contentPane.add(aboveTopButton);
    contentPane.add(aboveBottomButton);
    contentPane.add(topButton);
    contentPane.add(bottomButton);
    contentPane.add(belowTopButton);
    contentPane.add(belowBottomButton);
    frame.setSize(300, 200);
    frame.setVisible(true);
}

From source file:BorderSample.java

public static void main(String args[]) {
    JFrame frame = new JFrame("Sample Borders");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    Border bevelBorder = new BevelBorder(BevelBorder.RAISED, Color.red, Color.red.darker(), Color.pink,
            Color.pink.brighter());
    Border emptyBorder = new EmptyBorder(5, 10, 5, 10);
    Border etchedBorder = new EtchedBorder(EtchedBorder.RAISED, Color.red, Color.pink);
    Border lineBorder = new LineBorder(Color.red, 5);
    Icon diamondIcon = new DiamondIcon(Color.red);
    Border matteBorder = new MatteBorder(5, 10, 5, 10, diamondIcon);
    Border softBevelBorder = new SoftBevelBorder(BevelBorder.RAISED, Color.red, Color.red.darker(), Color.pink,
            Color.pink.brighter());
    Font font = new Font("Serif", Font.ITALIC, 12);
    Border titledBorder = new TitledBorder(lineBorder, "Hello", TitledBorder.LEFT, TitledBorder.BELOW_BOTTOM,
            font, Color.red);//from w w  w .  j av  a2  s .c o m
    Border compoundBorder = new CompoundBorder(lineBorder, matteBorder);

    JLabel bevelLabel = new JLabel("Bevel");
    bevelLabel.setBorder(bevelBorder);
    bevelLabel.setHorizontalAlignment(JLabel.CENTER);
    JLabel emptyLabel = new JLabel("Empty");
    emptyLabel.setBorder(emptyBorder);
    emptyLabel.setHorizontalAlignment(JLabel.CENTER);
    JLabel etchedLabel = new JLabel("Etched");
    etchedLabel.setBorder(etchedBorder);
    etchedLabel.setHorizontalAlignment(JLabel.CENTER);
    JLabel lineLabel = new JLabel("Line");
    lineLabel.setBorder(lineBorder);
    lineLabel.setHorizontalAlignment(JLabel.CENTER);
    JLabel matteLabel = new JLabel("Matte");
    matteLabel.setBorder(matteBorder);
    matteLabel.setHorizontalAlignment(JLabel.CENTER);
    JLabel softBevelLabel = new JLabel("Soft Bevel");
    softBevelLabel.setBorder(softBevelBorder);
    softBevelLabel.setHorizontalAlignment(JLabel.CENTER);
    JLabel titledLabel = new JLabel("Titled");
    titledLabel.setBorder(titledBorder);
    titledLabel.setHorizontalAlignment(JLabel.CENTER);
    JLabel compoundLabel = new JLabel("Compound");
    compoundLabel.setBorder(compoundBorder);
    compoundLabel.setHorizontalAlignment(JLabel.CENTER);

    Container contentPane = frame.getContentPane();
    contentPane.setLayout(new GridLayout(2, 4, 5, 5));
    contentPane.add(bevelLabel);
    contentPane.add(emptyLabel);
    contentPane.add(etchedLabel);
    contentPane.add(lineLabel);
    contentPane.add(matteLabel);
    contentPane.add(softBevelLabel);
    contentPane.add(titledLabel);
    contentPane.add(compoundLabel);
    frame.setSize(400, 200);
    frame.setVisible(true);
}

From source file:BorderDemo.java

public BorderDemo() {
    super("BorderDemo");
    Border blackline, etched, raisedbevel, loweredbevel, empty;

    //A border that puts 10 extra pixels at the sides and
    //bottom of each pane.
    Border paneEdge = BorderFactory.createEmptyBorder(0, 10, 10, 10);

    blackline = BorderFactory.createLineBorder(Color.black);
    etched = BorderFactory.createEtchedBorder();
    raisedbevel = BorderFactory.createRaisedBevelBorder();
    loweredbevel = BorderFactory.createLoweredBevelBorder();
    empty = BorderFactory.createEmptyBorder();

    //First pane: simple borders
    JPanel simpleBorders = new JPanel();
    simpleBorders.setBorder(paneEdge);/* w w w . j a v  a  2 s  .  c om*/
    simpleBorders.setLayout(new BoxLayout(simpleBorders, BoxLayout.Y_AXIS));

    addCompForBorder(blackline, "line border", simpleBorders);
    addCompForBorder(etched, "etched border", simpleBorders);
    addCompForBorder(raisedbevel, "raised bevel border", simpleBorders);
    addCompForBorder(loweredbevel, "lowered bevel border", simpleBorders);
    addCompForBorder(empty, "empty border", simpleBorders);

    //Second pane: matte borders
    JPanel matteBorders = new JPanel();
    matteBorders.setBorder(paneEdge);
    matteBorders.setLayout(new BoxLayout(matteBorders, BoxLayout.Y_AXIS));

    //XXX: We *should* size the component so that the
    //XXX: icons tile OK. Without that, the icons are
    //XXX: likely to be cut off and look bad.
    ImageIcon icon = new ImageIcon("images/left.gif"); //20x22
    Border border = BorderFactory.createMatteBorder(-1, -1, -1, -1, icon);
    addCompForBorder(border, "matte border (-1,-1,-1,-1,icon)", matteBorders);
    border = BorderFactory.createMatteBorder(1, 5, 1, 1, Color.red);
    addCompForBorder(border, "matte border (1,5,1,1,Color.red)", matteBorders);
    border = BorderFactory.createMatteBorder(0, 20, 0, 0, icon);
    addCompForBorder(border, "matte border (0,20,0,0,icon)", matteBorders);

    //Third pane: titled borders
    JPanel titledBorders = new JPanel();
    titledBorders.setBorder(paneEdge);
    titledBorders.setLayout(new BoxLayout(titledBorders, BoxLayout.Y_AXIS));
    TitledBorder titled;

    titled = BorderFactory.createTitledBorder("title");
    addCompForBorder(titled, "default titled border" + " (default just., default pos.)", titledBorders);

    titled = BorderFactory.createTitledBorder(blackline, "title");
    addCompForTitledBorder(titled, "titled line border" + " (centered, default pos.)", TitledBorder.CENTER,
            TitledBorder.DEFAULT_POSITION, titledBorders);

    titled = BorderFactory.createTitledBorder(etched, "title");
    addCompForTitledBorder(titled, "titled etched border" + " (right just., default pos.)", TitledBorder.RIGHT,
            TitledBorder.DEFAULT_POSITION, titledBorders);

    titled = BorderFactory.createTitledBorder(loweredbevel, "title");
    addCompForTitledBorder(titled, "titled lowered bevel border" + " (default just., above top)",
            TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.ABOVE_TOP, titledBorders);

    titled = BorderFactory.createTitledBorder(empty, "title");
    addCompForTitledBorder(titled, "titled empty border" + " (default just., bottom)",
            TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.BOTTOM, titledBorders);

    //Fourth pane: compound borders
    JPanel compoundBorders = new JPanel();
    compoundBorders.setBorder(paneEdge);
    compoundBorders.setLayout(new BoxLayout(compoundBorders, BoxLayout.Y_AXIS));
    Border redline = BorderFactory.createLineBorder(Color.red);

    Border compound;
    compound = BorderFactory.createCompoundBorder(raisedbevel, loweredbevel);
    addCompForBorder(compound, "compound border (two bevels)", compoundBorders);

    compound = BorderFactory.createCompoundBorder(redline, compound);
    addCompForBorder(compound, "compound border (add a red outline)", compoundBorders);

    titled = BorderFactory.createTitledBorder(compound, "title", TitledBorder.CENTER,
            TitledBorder.BELOW_BOTTOM);
    addCompForBorder(titled, "titled compound border" + " (centered, below bottom)", compoundBorders);

    JTabbedPane tabbedPane = new JTabbedPane();
    tabbedPane.addTab("Simple", null, simpleBorders, null);
    tabbedPane.addTab("Matte", null, matteBorders, null);
    tabbedPane.addTab("Titled", null, titledBorders, null);
    tabbedPane.addTab("Compound", null, compoundBorders, null);
    tabbedPane.setSelectedIndex(0);

    getContentPane().add(tabbedPane, BorderLayout.CENTER);
}

From source file:components.BorderDemo.java

public BorderDemo() {
    super(new GridLayout(1, 0));

    //Keep references to the next few borders,
    //for use in titles and compound borders.
    Border blackline, raisedetched, loweredetched, raisedbevel, loweredbevel, empty;

    //A border that puts 10 extra pixels at the sides and
    //bottom of each pane.
    Border paneEdge = BorderFactory.createEmptyBorder(0, 10, 10, 10);

    blackline = BorderFactory.createLineBorder(Color.black);
    raisedetched = BorderFactory.createEtchedBorder(EtchedBorder.RAISED);
    loweredetched = BorderFactory.createEtchedBorder(EtchedBorder.LOWERED);
    raisedbevel = BorderFactory.createRaisedBevelBorder();
    loweredbevel = BorderFactory.createLoweredBevelBorder();
    empty = BorderFactory.createEmptyBorder();

    //First pane: simple borders
    JPanel simpleBorders = new JPanel();
    simpleBorders.setBorder(paneEdge);//from   ww  w  .ja  v a 2s .  co m
    simpleBorders.setLayout(new BoxLayout(simpleBorders, BoxLayout.Y_AXIS));

    addCompForBorder(blackline, "line border", simpleBorders);
    addCompForBorder(raisedetched, "raised etched border", simpleBorders);
    addCompForBorder(loweredetched, "lowered etched border", simpleBorders);
    addCompForBorder(raisedbevel, "raised bevel border", simpleBorders);
    addCompForBorder(loweredbevel, "lowered bevel border", simpleBorders);
    addCompForBorder(empty, "empty border", simpleBorders);

    //Second pane: matte borders
    JPanel matteBorders = new JPanel();
    matteBorders.setBorder(paneEdge);
    matteBorders.setLayout(new BoxLayout(matteBorders, BoxLayout.Y_AXIS));

    ImageIcon icon = createImageIcon("images/wavy.gif", "wavy-line border icon"); //20x22
    Border border = BorderFactory.createMatteBorder(-1, -1, -1, -1, icon);
    if (icon != null) {
        addCompForBorder(border, "matte border (-1,-1,-1,-1,icon)", matteBorders);
    } else {
        addCompForBorder(border, "matte border (-1,-1,-1,-1,<null-icon>)", matteBorders);
    }
    border = BorderFactory.createMatteBorder(1, 5, 1, 1, Color.red);
    addCompForBorder(border, "matte border (1,5,1,1,Color.red)", matteBorders);

    border = BorderFactory.createMatteBorder(0, 20, 0, 0, icon);
    if (icon != null) {
        addCompForBorder(border, "matte border (0,20,0,0,icon)", matteBorders);
    } else {
        addCompForBorder(border, "matte border (0,20,0,0,<null-icon>)", matteBorders);
    }

    //Third pane: titled borders
    JPanel titledBorders = new JPanel();
    titledBorders.setBorder(paneEdge);
    titledBorders.setLayout(new BoxLayout(titledBorders, BoxLayout.Y_AXIS));
    TitledBorder titled;

    titled = BorderFactory.createTitledBorder("title");
    addCompForBorder(titled, "default titled border" + " (default just., default pos.)", titledBorders);

    titled = BorderFactory.createTitledBorder(blackline, "title");
    addCompForTitledBorder(titled, "titled line border" + " (centered, default pos.)", TitledBorder.CENTER,
            TitledBorder.DEFAULT_POSITION, titledBorders);

    titled = BorderFactory.createTitledBorder(loweredetched, "title");
    addCompForTitledBorder(titled, "titled lowered etched border" + " (right just., default pos.)",
            TitledBorder.RIGHT, TitledBorder.DEFAULT_POSITION, titledBorders);

    titled = BorderFactory.createTitledBorder(loweredbevel, "title");
    addCompForTitledBorder(titled, "titled lowered bevel border" + " (default just., above top)",
            TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.ABOVE_TOP, titledBorders);

    titled = BorderFactory.createTitledBorder(empty, "title");
    addCompForTitledBorder(titled, "titled empty border" + " (default just., bottom)",
            TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.BOTTOM, titledBorders);

    //Fourth pane: compound borders
    JPanel compoundBorders = new JPanel();
    compoundBorders.setBorder(paneEdge);
    compoundBorders.setLayout(new BoxLayout(compoundBorders, BoxLayout.Y_AXIS));
    Border redline = BorderFactory.createLineBorder(Color.red);

    Border compound;
    compound = BorderFactory.createCompoundBorder(raisedbevel, loweredbevel);
    addCompForBorder(compound, "compound border (two bevels)", compoundBorders);

    compound = BorderFactory.createCompoundBorder(redline, compound);
    addCompForBorder(compound, "compound border (add a red outline)", compoundBorders);

    titled = BorderFactory.createTitledBorder(compound, "title", TitledBorder.CENTER,
            TitledBorder.BELOW_BOTTOM);
    addCompForBorder(titled, "titled compound border" + " (centered, below bottom)", compoundBorders);

    JTabbedPane tabbedPane = new JTabbedPane();
    tabbedPane.addTab("Simple", null, simpleBorders, null);
    tabbedPane.addTab("Matte", null, matteBorders, null);
    tabbedPane.addTab("Titled", null, titledBorders, null);
    tabbedPane.addTab("Compound", null, compoundBorders, null);
    tabbedPane.setSelectedIndex(0);
    String toolTip = new String(
            "<html>Blue Wavy Line border art crew:<br>&nbsp;&nbsp;&nbsp;Bill Pauley<br>&nbsp;&nbsp;&nbsp;Cris St. Aubyn<br>&nbsp;&nbsp;&nbsp;Ben Wronsky<br>&nbsp;&nbsp;&nbsp;Nathan Walrath<br>&nbsp;&nbsp;&nbsp;Tommy Adams, special consultant</html>");
    tabbedPane.setToolTipTextAt(1, toolTip);

    add(tabbedPane);
}

From source file:BorderDemo.java

public BorderDemo() {
    super(new GridLayout(1, 0));

    // Keep references to the next few borders,
    // for use in titles and compound borders.
    Border blackline, raisedetched, loweredetched, raisedbevel, loweredbevel, empty;

    // A border that puts 10 extra pixels at the sides and
    // bottom of each pane.
    Border paneEdge = BorderFactory.createEmptyBorder(0, 10, 10, 10);

    blackline = BorderFactory.createLineBorder(Color.black);
    raisedetched = BorderFactory.createEtchedBorder(EtchedBorder.RAISED);
    loweredetched = BorderFactory.createEtchedBorder(EtchedBorder.LOWERED);
    raisedbevel = BorderFactory.createRaisedBevelBorder();
    loweredbevel = BorderFactory.createLoweredBevelBorder();
    empty = BorderFactory.createEmptyBorder();

    // First pane: simple borders
    JPanel simpleBorders = new JPanel();
    simpleBorders.setBorder(paneEdge);//from   w  w  w.  j  a  v a  2s. com
    simpleBorders.setLayout(new BoxLayout(simpleBorders, BoxLayout.Y_AXIS));

    addCompForBorder(blackline, "line border", simpleBorders);
    addCompForBorder(raisedetched, "raised etched border", simpleBorders);
    addCompForBorder(loweredetched, "lowered etched border", simpleBorders);
    addCompForBorder(raisedbevel, "raised bevel border", simpleBorders);
    addCompForBorder(loweredbevel, "lowered bevel border", simpleBorders);
    addCompForBorder(empty, "empty border", simpleBorders);

    // Second pane: matte borders
    JPanel matteBorders = new JPanel();
    matteBorders.setBorder(paneEdge);
    matteBorders.setLayout(new BoxLayout(matteBorders, BoxLayout.Y_AXIS));

    ImageIcon icon = createImageIcon("images/wavy.gif", "wavy-line border icon"); // 20x22
    Border border = BorderFactory.createMatteBorder(-1, -1, -1, -1, icon);
    if (icon != null) {
        addCompForBorder(border, "matte border (-1,-1,-1,-1,icon)", matteBorders);
    } else {
        addCompForBorder(border, "matte border (-1,-1,-1,-1,<null-icon>)", matteBorders);
    }
    border = BorderFactory.createMatteBorder(1, 5, 1, 1, Color.red);
    addCompForBorder(border, "matte border (1,5,1,1,Color.red)", matteBorders);

    border = BorderFactory.createMatteBorder(0, 20, 0, 0, icon);
    if (icon != null) {
        addCompForBorder(border, "matte border (0,20,0,0,icon)", matteBorders);
    } else {
        addCompForBorder(border, "matte border (0,20,0,0,<null-icon>)", matteBorders);
    }

    // Third pane: titled borders
    JPanel titledBorders = new JPanel();
    titledBorders.setBorder(paneEdge);
    titledBorders.setLayout(new BoxLayout(titledBorders, BoxLayout.Y_AXIS));
    TitledBorder titled;

    titled = BorderFactory.createTitledBorder("title");
    addCompForBorder(titled, "default titled border" + " (default just., default pos.)", titledBorders);

    titled = BorderFactory.createTitledBorder(blackline, "title");
    addCompForTitledBorder(titled, "titled line border" + " (centered, default pos.)", TitledBorder.CENTER,
            TitledBorder.DEFAULT_POSITION, titledBorders);

    titled = BorderFactory.createTitledBorder(loweredetched, "title");
    addCompForTitledBorder(titled, "titled lowered etched border" + " (right just., default pos.)",
            TitledBorder.RIGHT, TitledBorder.DEFAULT_POSITION, titledBorders);

    titled = BorderFactory.createTitledBorder(loweredbevel, "title");
    addCompForTitledBorder(titled, "titled lowered bevel border" + " (default just., above top)",
            TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.ABOVE_TOP, titledBorders);

    titled = BorderFactory.createTitledBorder(empty, "title");
    addCompForTitledBorder(titled, "titled empty border" + " (default just., bottom)",
            TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.BOTTOM, titledBorders);

    // Fourth pane: compound borders
    JPanel compoundBorders = new JPanel();
    compoundBorders.setBorder(paneEdge);
    compoundBorders.setLayout(new BoxLayout(compoundBorders, BoxLayout.Y_AXIS));
    Border redline = BorderFactory.createLineBorder(Color.red);

    Border compound;
    compound = BorderFactory.createCompoundBorder(raisedbevel, loweredbevel);
    addCompForBorder(compound, "compound border (two bevels)", compoundBorders);

    compound = BorderFactory.createCompoundBorder(redline, compound);
    addCompForBorder(compound, "compound border (add a red outline)", compoundBorders);

    titled = BorderFactory.createTitledBorder(compound, "title", TitledBorder.CENTER,
            TitledBorder.BELOW_BOTTOM);
    addCompForBorder(titled, "titled compound border" + " (centered, below bottom)", compoundBorders);

    JTabbedPane tabbedPane = new JTabbedPane();
    tabbedPane.addTab("Simple", null, simpleBorders, null);
    tabbedPane.addTab("Matte", null, matteBorders, null);
    tabbedPane.addTab("Titled", null, titledBorders, null);
    tabbedPane.addTab("Compound", null, compoundBorders, null);
    tabbedPane.setSelectedIndex(0);
    String toolTip = new String(
            "<html>Blue Wavy Line border art crew:<br>&nbsp;&nbsp;&nbsp;Bill Pauley<br>&nbsp;&nbsp;&nbsp;Cris St. Aubyn<br>&nbsp;&nbsp;&nbsp;Ben Wronsky<br>&nbsp;&nbsp;&nbsp;Nathan Walrath<br>&nbsp;&nbsp;&nbsp;Tommy Adams, special consultant</html>");
    tabbedPane.setToolTipTextAt(1, toolTip);

    add(tabbedPane);
}