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.


>> REGISTER NOW TO START POSTING


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

Results 1 to 4 of 4

Thread: taking JFrame title into account when calling pack()

  1. #1
    Member
    Join Date
    Oct 2010
    Posts
    31
    Thanks
    2
    Thanked 1 Time in 1 Post

    Default taking JFrame title into account when calling pack()

    Hello,

    I'm wondering if there's an alternative to JFrame.pack() that takes into account the size of the title text (or maybe a flag that tell's it to take the title into account). I have a few simple GUIs that look good after calling pack() but the titles are like "Lev...", "Qui...", etc.


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,139
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: taking JFrame title into account when calling pack()

    An alternative would be setSize

  3. The Following User Says Thank You to Norm For This Useful Post:

    gib65 (October 7th, 2010)

  4. #3
    Member Darryl.Burke's Avatar
    Join Date
    Mar 2010
    Location
    Madgaon, Goa, India
    Posts
    494
    Thanks
    8
    Thanked 48 Times in 46 Posts

    Default Re: taking JFrame title into account when calling pack()

    Last edited by Darryl.Burke; October 7th, 2010 at 01:29 AM. Reason: Underlined links

  5. The Following User Says Thank You to Darryl.Burke For This Useful Post:

    gib65 (October 7th, 2010)

  6. #4
    Member
    Join Date
    Oct 2010
    Posts
    31
    Thanks
    2
    Thanked 1 Time in 1 Post

    Default Re: taking JFrame title into account when calling pack()

    Thanks both.

Similar Threads

  1. Setting JFrame maximum size that pack() can not violate
    By Javabeginner in forum AWT / Java Swing
    Replies: 3
    Last Post: September 3rd, 2010, 05:53 AM
  2. Java equivalent of Python’s struct.pack?
    By thiruvadi.e in forum Java SE APIs
    Replies: 2
    Last Post: July 14th, 2010, 03:09 AM
  3. Taking an element out of an array
    By SlckP in forum Collections and Generics
    Replies: 3
    Last Post: May 5th, 2010, 02:26 PM
  4. About Title border in jscrollpane
    By subhvi in forum AWT / Java Swing
    Replies: 2
    Last Post: December 15th, 2009, 12:45 AM
  5. JFrame, frame's title doesnt appear.
    By chronoz13 in forum AWT / Java Swing
    Replies: 1
    Last Post: November 26th, 2009, 03:38 PM