GridLayout with single column

Posted by Albinoswordfish on Stack Overflow See other posts from Stack Overflow or by Albinoswordfish
Published on 2010-04-27T03:53:14Z Indexed on 2010/04/27 4:13 UTC
Read the original article Hit count: 374

Filed under:
|

Right now I'm trying to use a GridLayout with only a single column. However I'm having a problem where I don't want the object, in this case a JButton, to be stretched the entire width of the JPanel that it's on. Is there a way to decrease the width of the JButton so that it does not stretch the entire width of the JPanel. I've tried using setPreferredSize and setSize with no results.

Is this just the way GridLayout works or is there something I'm missing?

© Stack Overflow or respective owner

Related posts about java

Related posts about swing