Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!usenet.ukfsn.org!not-for-mail From: Martin Gregorie Newsgroups: comp.lang.java.programmer Subject: Re: How to align swing buttons vertically ? Date: Sun, 13 Nov 2011 14:38:42 +0000 (UTC) Organization: UK Free Software Network Lines: 21 Message-ID: References: <4ebf9c51$0$5055$ba620e4c@news.skynet.be> <4ebfc473$0$5044$ba620e4c@news.skynet.be> NNTP-Posting-Host: 84.45.235.129 Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Trace: localhost.localdomain 1321195122 32067 84.45.235.129 (13 Nov 2011 14:38:42 GMT) X-Complaints-To: usenet@localhost.localdomain NNTP-Posting-Date: Sun, 13 Nov 2011 14:38:42 +0000 (UTC) User-Agent: Pan/0.135 (Tomorrow I'll Wake Up and Scald Myself with Tea; GIT 30dc37b master) Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:9908 On Sun, 13 Nov 2011 14:21:55 +0100, Olivier Scalbert wrote: > On 11/13/2011 01:50 PM, Martin Gregorie wrote: >> Use a BoxLayout specifying the axis as Y-AXIS. >> >> > Thanks ! > But with the BoxLayout they are aligned but they have not the same size! > That's nothing to do with the layout. It aligns the objects you're laying out by doing its best with the sizes of the objects you created. JButton inherits size setting methods (setMaximumSize, setMinimumSize, setPreferredSize) from JComponent. Use them to control button size. -- martin@ | Martin Gregorie gregorie. | Essex, UK org |