JButtons on GridLayout - MineSweeper
问题 I'm writing MineSweeper and using JButton s on a GridLayout . The numbers of rows and columns are entered by the user, so setting fixed size may cause several problems. How can I remove the space between the buttons without setting the fixed size of the panel? 回答1: This seems to be more of a issue with JButton then with GridLayout Here, I replaced JButton with JPanel (and some border magic) The other thing I tried was passing a negative h/vgap to the GridLayout I'd however not recommend this,