user1060187
user1060187

Reputation: 987

JScrollPane - multiple Images on new line

I currently have a JScrollPane in a JPanel. I have Images that are loaded into the JPanel from a database so the amount of Images that load varies.

I have set the JFrame that the JScrollPane is found on to a size of 800 * 800. Atm the pictures from the database just load on one massive line across the screen and the JScrollPane helps to see these but I would like to make a new break after three Images.

What would the best way be to go about this?

Upvotes: 1

Views: 343

Answers (1)

Jakub Zaverka
Jakub Zaverka

Reputation: 8874

Use GridLayout with 3 columns for the JPanel.

Upvotes: 4

Related Questions