Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

import javax.swing.BorderFactory;
import javax.swing.ImageIcon;
import javax.swing.JLabel;
import javax.swing.border.MatteBorder;

public class Main {
    public static void main(String[] argv) {
        ImageIcon icon = new ImageIcon("image.gif");
        MatteBorder matteBorder = (MatteBorder) BorderFactory.createMatteBorder(-1, -1, -1, -1, icon);
        JLabel component = new JLabel("label");
        component.setBorder(matteBorder);

    }
}