create Empty Border - Java Swing

Java examples for Swing:Border

Description

create Empty Border

Demo Code


//package com.java2s;
import javax.swing.BorderFactory;

import javax.swing.border.Border;

public class Main {
    public static void main(String[] argv) throws Exception {
        int margin = 2;
        System.out.println(createEmptyBorder(margin));
    }//from  w w  w  . j  a  v  a  2 s  .  co  m

    public static Border createEmptyBorder(int margin) {
        return BorderFactory.createEmptyBorder(margin, margin, margin,
                margin);
    }
}

Related Tutorials