|
-
May 15th, 2001, 07:40 PM
#1
Thread Starter
Dazed Member
Sizing Components? [resolved]
Does anyone know how i can go about adding buttons to a
container in a single vertical column where all the buttons have
the same size regardless of there text? I tried The setPerferredSize() and setMaximumSize() methods from the JComponent class but i dont get the results i want....
Thanks....
JFrame jf = new JFrame("TestFrame");
Container content = jf.getContentPane();
content.setLayout(new BoxLayout(content,BoxLayout.Y_AXIS));
JButton Big = new JButton("Big");
JButton Bigger = new JButton("Bigger");
JButton Even Bigger = new JButton("Even Bigger");
JButton Really really Big = new JButton("Really really Big ");
JButton = The Biggest of the Big new JButton(" The Biggest of the Big");
content.add(Big);
content.add(Bigger);
content.add(Even Bigger);
content.add(Really really Big);
content.add(The Biggest of the Big);
Last edited by Dilenger4; Oct 15th, 2001 at 12:05 PM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|