TitledBorder 3 : Border « Swing JFC « Java

Java
1. 2D Graphics GUI
2. 3D
3. Advanced Graphics
4. Ant
5. Apache Common
6. Chart
7. Class
8. Collections Data Structure
9. Data Type
10. Database SQL JDBC
11. Design Pattern
12. Development Class
13. EJB3
14. Email
15. Event
16. File Input Output
17. Game
18. Generics
19. GWT
20. Hibernate
21. I18N
22. J2EE
23. J2ME
24. JDK 6
25. JNDI LDAP
26. JPA
27. JSP
28. JSTL
29. Language Basics
30. Network Protocol
31. PDF RTF
32. Reflection
33. Regular Expressions
34. Scripting
35. Security
36. Servlets
37. Spring
38. Swing Components
39. Swing JFC
40. SWT JFace Eclipse
41. Threads
42. Tiny Application
43. Velocity
44. Web Services SOA
45. XML
Java Tutorial
Java Source Code / Java Documentation
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java » Swing JFC » BorderScreenshots 
TitledBorder 3
TitledBorder 3
   
import java.awt.Container;
import java.awt.GridLayout;

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

public class TitledPostBorder {
  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);
    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(32));
    contentPane.add(aboveTopButton);
    contentPane.add(aboveBottomButton);
    contentPane.add(topButton);
    contentPane.add(bottomButton);
    contentPane.add(belowTopButton);
    contentPane.add(belowBottomButton);
    frame.setSize(300200);
    frame.setVisible(true);
  }
}

           
         
    
    
  
Related examples in the same category
1. Border Demo Border Demo
2. Different Swing bordersDifferent Swing borders
3. demonstrate the custom CurvedBorder classdemonstrate the custom CurvedBorder class
4. An example of the MatteBorder classAn example of the MatteBorder class
5. A simple demonstration of the LineBorder class built with rounded cornersA simple demonstration of the LineBorder class built with rounded corners
6. An example of using a titled border on a labelAn example of using a titled border on a label
7. Borders with a BevelBorder used on JLabels as a highlightBorders with a BevelBorder used on JLabels as a highlight
8. MatteBorder DemoMatteBorder Demo
9. TitledBorder DemoTitledBorder Demo
10. Custom Border SampleCustom Border Sample
11. How to create the borderHow to create the border
12. Solid border button border 3D borderSolid border button border 3D border
13. Oval borderOval border
14. Border of all kindsBorder of all kinds
15. EtchedBorderEtchedBorder
16. Red Green BorderRed Green Border
17. TitledBorderTitledBorder
18. BevelBorder 2BevelBorder 2
19. Icon MatteBorderIcon MatteBorder
20. Soft BevelBorderSoft BevelBorder
21. Another TitledBorder 1Another TitledBorder 1
22. BevelBorderBevelBorder
23. EmptyBorderEmptyBorder
24. LineBorder DemoLineBorder Demo
25. CompoundBorder DemoCompoundBorder Demo
26. Adding a Title to a Border
27. Create a title border from another border
28. Change border text Justification alignment style
29. Bottom Border
30. Right border
31. Rectangle border
32. Set title position
33. Flex Border
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.