Suhail Gupta Suhail Gupta - 2 months ago 6
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.

Comments