Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.gui > #2314
| From | "Andrew Thompson" <andrew.thompson@THRWHITE.remove-dii-this> |
|---|---|
| Subject | Re: JButton.setMargin bro |
| Message-ID | <7742e32606cba@uwe> (permalink) |
| Newsgroups | comp.lang.java.gui |
| References | <i692d3t1r2i1dr3jbhmsjmt3gkib3i7tc9@4ax.com> |
| Date | 2011-04-27 15:38 +0000 |
| Organization | TDS.net |
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.
<sscce>
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 );
}
}
</sscce>
>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
Back to comp.lang.java.gui | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
JButton.setMargin broken "Roedy Green" <roedy.green@THRWHITE.remove-dii-this> - 2011-04-27 15:38 +0000
Re: JButton.setMargin bro "Andrew Thompson" <andrew.thompson@THRWHITE.remove-dii-this> - 2011-04-27 15:38 +0000
Re: JButton.setMargin bro "Roedy Green" <roedy.green@THRWHITE.remove-dii-this> - 2011-04-27 15:38 +0000
Re: JButton.setMargin bro "Andrew Thompson" <andrew.thompson@THRWHITE.remove-dii-this> - 2011-04-27 15:38 +0000
Re: JButton.setMargin bro "usenet" <usenet@THRWHITE.remove-dii-this> - 2011-04-27 15:38 +0000
Re: JButton.setMargin bro "Roedy Green" <roedy.green@THRWHITE.remove-dii-this> - 2011-04-27 15:38 +0000
Re: JButton.setMargin bro "Roedy Green" <roedy.green@THRWHITE.remove-dii-this> - 2011-04-27 15:38 +0000
csiph-web