expandable JPanel while adding items
I have a JFrame and I added JPanel inside it
However, I designed in a way, I can add JButton to that panel
it is used as a bookshelf
btn 1 btn2 btn3
so each time i add, it goes three columns and then shift down to a new row
this worked perfect, I added JScrollPane to that panel
I want this to go unlimited number of rows,
so, until now, whe I add 8 rows it works find, the Jscroll shows all the jbutton
but when I add more buttons it goes under the frame/or panel
and JScroll does not show it.
I tried to play with (setperefredsize)
but no solution. How can I accomplish this?
Also, is this a good practice? I mean having unlimited Height size for panel?
that is, adding new jbutton will cause to extend the panel withing the JScroll, with no fix number.
is this good practice?