Java tutorial
//package com.java2s; import java.awt.Component; import java.awt.Dimension; import javax.swing.Box; public class Main { /** Creates a 5 x 5 rigid spacer. */ public static Component createRigidSpacer() { return createRigidSpacer(5); } /** Creates a <code>size</code> x <code>size</code> rigid spacer. */ public static Component createRigidSpacer(final int size) { return createRigidSpacer(size, size); } /** Creates a <code>width</code> x <code>height</code> rigid spacer. */ public static Component createRigidSpacer(final int width, final int height) { return Box.createRigidArea(new Dimension(width, height)); } }