Welcome to the Java Programming Forums

The professional, friendly Java community. 21,500 members and growing!

The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: Relationship of sizes

  1. #1
    Junior Member
    Join Date
    Jan 2012
    Thanked 0 Times in 0 Posts

    Default Relationship of sizes

    There are 4 sizes:
    Maximum Size
    Minimum Size
    Preferred Size
    I can't understand their relationship. My guess is:
    1. No size could be greater than MaximumSize and if you went above Maximum Size java would reset your value to Maximum Size.

    2. No size could be less than Minimum Size and if you went below Minimum Size java would reset your value to Minimum Size.

    3. Preferred Size is size that is used if you don't set the size.

    4. Size is the current size.

    But that is not the way the process works. Java always uses the Preferred Size on a JScrollpane no matter what the other values are.

    What am I missing? Thank you.

  2. #2
    Crazy Cat Lady KevinWorkman's Avatar
    Join Date
    Oct 2010
    Washington, DC
    My Mood
    Thanked 636 Times in 540 Posts

    Default Re: Relationship of sizes

    These values are used by different layouts differently. Recommended reading: Lesson: Laying Out Components Within a Container (The Java™ Tutorials > Creating a GUI With JFC/Swing)
    Useful links: How to Ask Questions the Smart Way | Use Code Tags | Java Tutorials
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

Similar Threads

  1. Replies: 5
    Last Post: October 19th, 2011, 08:21 PM