Reputation: 2188
I'm looking for a way to set the width of a JButton to match the width of the cell it's currently located in. I have 3 cells, each with a button, but the button size varies. I used to work a little bit with html, so all I had to do is add % at the end of variable. How can I do that for JButton?
EDIT: Just in case someone else is looking for the solution. MigLayer allows usage of percents, but I found something more soothing to my needs:
MigLayout("", "[grow, fill]", "[]")
EDIT2: As requested here's the screenshot of desired effect:
Upvotes: 2
Views: 2805
Reputation: 64632
Vedrane,
MigLayout allows for using percantages as a unit of measure
Upvotes: 4
Reputation: 168825
This can probably be achieved by adding the buttons to a single row GridLayout
.
Upvotes: 2