TitledBorder.BELOW_BOTTOM : TitledBorder « javax.swing.border « Java by API






TitledBorder.BELOW_BOTTOM


import java.awt.Container;

import javax.swing.BorderFactory;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.border.TitledBorder;



public class MainClass {

  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);
    frame.setSize(300, 200);
    frame.setVisible(true);
  }
}
           
       








Related examples in the same category

1.TitledBorder.ABOVE_BOTTOM
2.TitledBorder.ABOVE_TOP
3.TitledBorder.BELOW_TOP
4.TitledBorder.BOTTOM
5.TitledBorder.CENTER
6.TitledBorder.LEFT
7.TitledBorder.RIGHT
8.TitledBorder.TOP
9.new TitledBorder(Border border, String title)
10.new TitledBorder(Border border, String title, int titleJustification, int titlePosition, Font titleFont, Color titleColor)
11.new TitledBorder(Border border, String title, int titleJustification, int titlePosition)
12.TitledBorder: setTitleJustification(int pos)
13.TitledBorder: setTitlePosition(int pos)