setting horizontal and vertical margins

Suhail Gupta picture Suhail Gupta · May 2, 2011 · Viewed 27.4k times · Source

What is the method to set horizontal and vertical margins in a panel? (The same we have in html style="margins:30px")

Answer

Suhail Gupta picture Suhail Gupta · May 5, 2011

use setBorder(BorderFactory.createEmptyBorder(int top, int left, int bottom, int right); for more reference visit this.