Problem with FlowLayout
Posted
by atch
on Stack Overflow
See other posts from Stack Overflow
or by atch
Published on 2010-03-29T13:47:30Z
Indexed on
2010/03/29
13:53 UTC
Read the original article
Hit count: 473
public class MyFrame extends JFrame
{
public MyFrame(String title)
{
setSize(200, 200);
setTitle(Integer.toString(super.getSize().width));
setLayout(new FlowLayout());
for (int i = 0; i < 5; ++i)
{
JButton b = new JButton();
b.setSize(90,50);
b.setText(Integer.toString(b.getSize().width));
this.add(b);![alt text][1]
}
this.setVisible(true);
}
}
why if having button widht 90 I'm getting window where three buttons are in one row instead of two?
© Stack Overflow or respective owner