Path: csiph.com!x330-a1.tempe.blueboxinc.net!feeder1.hal-mli.net!nx02.iad01.newshosting.com!newshosting.com!69.16.185.11.MISMATCH!npeer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!news-in-01.newsfeed.easynews.com!easynews.com!easynews!news-out.news.tds.net!newsreading01.news.tds.net!86597e80!not-for-mail From: "Andrew Thompson" Subject: Re: JButton.setMargin bro Message-ID: <7742e32606cba@uwe> X-Comment-To: comp.lang.java.gui Newsgroups: comp.lang.java.gui In-Reply-To: References: Content-Type: text/plain; charset=IBM437 Content-Transfer-Encoding: 8bit X-Gateway: time.synchro.net [Synchronet 3.15a-Win32 NewsLink 1.92] Lines: 45 Date: Wed, 27 Apr 2011 15:38:23 GMT NNTP-Posting-Host: 96.60.20.240 X-Complaints-To: news@tds.net X-Trace: newsreading01.news.tds.net 1303918703 96.60.20.240 (Wed, 27 Apr 2011 10:38:23 CDT) NNTP-Posting-Date: Wed, 27 Apr 2011 10:38:23 CDT Organization: TDS.net Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.gui:2314 To: comp.lang.java.gui Roedy Green wrote: >It seems that Swing ignores JButton.setMargin. Is that your finding? No. This code produces one small and one big button here, using Java 1.6. import java.awt.*; import javax.swing.*; class ButtonMargin { public static void main(String[] args) { JPanel p = new JPanel(); JButton btn1 = new JButton("button 1"); p.add(btn1); JButton btn2 = new JButton("button 2"); Insets insets = new Insets(100,100,100,100); btn2.setMargin(insets); p.add(btn2); p.validate(); JOptionPane.showMessageDialog( null, p ); } } >Is this a bug or is there some excuse for it? The layouts being used in the code that fails? -- Andrew Thompson http://www.athompson.info/andrew/ Message posted via http://www.javakb.com --- * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet! --- Synchronet 3.15a-Win32 NewsLink 1.92 Time Warp of the Future BBS - telnet://time.synchro.net:24