facebook

Size troubles

  1. MyEclipse Archived
  2.  > 
  3. Matisse/Swing UI Development
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #285313 Reply

    pbassi
    Member

    Hi,

    In a JFrame created with Swing/Matisse, why the size of the components (such as Jpanel) are not set at the end of the initComponents (although a pack() is called at the end of the initComponents)?

    when is it appropriate to call methods such as getWidth() or getHeight within a JFrame?

    Thanks in advance
    Paolo

    #285360 Reply

    Riyad Kalla
    Member

    Paolo,
    Every component in Swing has a ‘preferredSize’ that is used and even when sizes are set, depending on the layout manager you are using, the size you are setting still might not be honored; that is what the min/max size limits are for.

    Unless you are setting a size, there won’t be any size arguments in the initComponents method.

Viewing 2 posts - 1 through 2 (of 2 total)
Reply To: Size troubles

You must be logged in to post in the forum log in