/* The program demonstrates bevel border * */ import javax.swing.*; import javax.swing.border.*; public class BevelBorder extends JFrame { JPanel panel; public BevelBorder() { // Sets the title of the window setTitle("Border Window"); // Sets the size of window setSize(300, 400); // Sets the action when the window is close setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); // Creates a panel panel = new JPanel(); // Creates a border name title Border b = BorderFactory.createTitledBorder("Title"); panel.setBorder(b); // Adds the panel to the content pane add(panel); // Sets the window to be visible setVisible(true); } public static void main(String[] args) { new BevelBorder(); } }