Here you can find the source of createBlankColorPanel(int height, int width, Color bkColor)
public static JPanel createBlankColorPanel(int height, int width, Color bkColor)
//package com.java2s; //License from project: Open Source License import java.awt.Color; import java.awt.Insets; import javax.swing.JPanel; import javax.swing.border.EmptyBorder; public class Main { public static JPanel createBlankColorPanel(int inset, Color bkColor) { JPanel pane = new JPanel(); pane.setBorder(new EmptyBorder(new Insets(inset, inset, inset, inset))); pane.setBackground(bkColor);//from w ww . ja v a2s . com return pane; } public static JPanel createBlankColorPanel(int height, int width, Color bkColor) { JPanel pane = new JPanel(); pane.setBorder(new EmptyBorder(new Insets(height, width, height, width))); pane.setBackground(bkColor); return pane; } }