user8763033
user8763033

Reputation:

How to add gaps between components in Jscrollpane?

I am using JScrollpane and adding buttons on it dynamically. JScrollpane does not allow use of layouts. I want to increase space vertically and horizontally between buttons.

Upvotes: 1

Views: 92

Answers (1)

Programmer
Programmer

Reputation: 813

Add JPanel to your JScrollPane, and change the layout of the JPanel. After that, you can build all your gui inside your JPanel without the limitation of JScrollPane.

Upvotes: 1

Related Questions