Suhail Gupta Suhail Gupta - 4 months ago 9
Java Question

setting horizontal and verical margins

What is the method to set horizontal and vertical margins in a panel? (The same we have in html

style="margins:30px"
)

Answer

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