I’m coding a minesweeper clone and what I have problem with right now is the ratio of buttons on my grid – I want to allow users to resize the window as they please but I’d love the buttons to keep the same 1:1 width/height ratio rather than becoming pancakes or prison bars under some circumstances 🙂 Is there some way to easily force the JButton to always remain square without giving it a fixed width and height?
Share
You can write a custom
LayoutManagere.g.GridLayoutextension and set the children sizes.