Results 1 to 7 of 7

Thread: Sizing Components? [resolved]

Threaded View

  1. #1

    Thread Starter
    Dazed Member
    Join Date
    Oct 1999
    Location
    Ridgefield Park, NJ
    Posts
    3,418

    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);

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width