How do I set the width and height to a JButton using a (gridLayout) ?
Printable View
How do I set the width and height to a JButton using a (gridLayout) ?
you can use setSize or setBounds methods o JButton class
:S
Solved my own problem after looking a bit, maybe I shoulda waited before I posted this, but the simplest solution I found is:
buttonName.setPreferredSize(new Dimension(ButtonWidth, ButtonHeight));
i don't know how this works in other layouts, but in a gridLayout w/ panels etc. it works like a charm
why not? have you checked it?
Most layouts respect the component preferred size. See Laying Out Components