i have a java application and i want to create a responsive "grid layout" for images. For example, i have 10 images, each 200px X 200px, current application window width is 1000px, so i want to have 5 images in first row and 5 images in second. If the window resizes to 1200px width, i want to have 6 images in first row and 4 in second....
Any ideas how to achieve this, which layout manager should i use?
I have tried gridLayout, and i am computing number of rows and cols during each window resize, but this looks more like workaround than a good solution.