EtchedBorderBorderFactory.java Source code

Java tutorial

Introduction

Here is the source code for EtchedBorderBorderFactory.java

Source

import javax.swing.BorderFactory;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;

public class EtchedBorderBorderFactory extends JFrame {

    public EtchedBorderBorderFactory() {
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        JPanel panel = new JPanel();
        JLabel label;

        label = new JLabel("Etched");
        label.setBorder(BorderFactory.createEtchedBorder());
        panel.add(label);
        getContentPane().add(panel);
        pack();
    }

    public static void main(String[] args) {
        EtchedBorderBorderFactory s = new EtchedBorderBorderFactory();
        s.setVisible(true);
    }
}