Source Code : An example of the MatteBorder class
Java Is Open Source Programming Language You Can Download From Java and Java Libraries From http://www.oracle.com.
Click Here to download
We provide this code related to title for you to solve your developing problem easily. Libraries which is import in this program you can download from http://www.oracle.com.
Click Here or search from google with Libraries Name you get jar file related it
An example of the MatteBorder class

import java.awt.Color;
import java.awt.GridLayout;
import javax.swing.Icon;
import javax.swing.ImageIcon;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.border.MatteBorder;
public class MatteExample extends JPanel {
public MatteExample() {
super(true);
this.setLayout(new GridLayout(1, 2, 5, 5));
JLabel label1 = new JLabel("Matte Border");
JLabel label2 = new JLabel("Matte Border (Icon)");
label1.setHorizontalAlignment(JLabel.CENTER);
label2.setHorizontalAlignment(JLabel.CENTER);
Icon icon = new ImageIcon("yourFile.gif");
MatteBorder matte = new MatteBorder(35, 35, 35, 35, Color.blue);
MatteBorder matteicon = new MatteBorder(35, 35, 35, 35, icon);
label1.setBorder(matte);
label2.setBorder(matteicon);
add(label1);
add(label2);
}
public static void main(String s[]) {
JFrame frame = new JFrame("Matte Borders");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setSize(500, 200);
frame.setContentPane(new MatteExample());
frame.setVisible(true);
}
}
Thank with us