Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6858461
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T02:09:43+00:00 2026-05-27T02:09:43+00:00

I feel like I must be doing something really stupid. What can I do

  • 0

I feel like I must be doing something really stupid. What can I do to have the size of the HTMLFlow be sized base on the content? I don’t need this to be done dynamically, just the first and only time it’s created. Below are two ways I’ve tried it (with various permutations not listed) with no luck. I’ve also tried with a Label to no avail.

    HLayout layout = new HLayout();
    layout.setWidth100();
    layout.setHeight(25);

    HTMLFlow bodyTypeLabel = new HTMLFlow();
    bodyTypeLabel.setHeight(25);
    bodyTypeLabel.setContents(wrapFontFace("longer content", "verdana", "2"));

    HTMLFlow drinkLabel = new HTMLFlow();
    drinkLabel.setHeight(25);
    drinkLabel.setWidth(10);
    drinklabel.setAutoWidth();
    drinkLabel.setOverflow(Overflow.VISIBLE);
    drinkLabel.setContents(wrapFontFace("content2", "verdana", "2"));

Basically, with either one, it seems no matter what, the width is set to some fixed value that doesn’t change.

It’ll end up looking like

longer content            content2

or

longer content2
content

In that second example, ‘longer content’ should be on one line, as it’s a separate label/htmlflow from ‘content2’. So, I either get a lot of extra spacing, or word wrapping. This seems like it should be simple so could anyone help me out here? I want it to look like:

longer content content2
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T02:09:44+00:00Added an answer on May 27, 2026 at 2:09 am

    Looks like this does the trick for me:

    drinkLabel.setHeight(25);
    drinkLabel.setWidth(10);
    drinkLabel.setOverflow(Overflow.VISIBLE);
    drinkLabel.setContents(wrapFontFace(drinkContent, "verdana", "2"));
    drinkLabel.setWrap(false);
    drinkLabel.setExtraSpace(5);
    

    That last bit is because it seems it trims spaces from the content, grr. I wish there was some way to not have it do that.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I feel like I must be missing something completely obvious, but I don't see
I'm at a point in my development learning where I feel like I must
I feel like this is a stupid question because it seems like common sense
I feel like this is a dumb question and I'm missing something, but I
I feel like i am completely missing something because I am not able to
I feel silly asking this, I must be missing something obvious. My javascript looks
I feel like I must just be unable to find it. Is there any
In grails I can set the password field to have a minimum size constraint
I recently started using Jira with the GreenHopper plugin. However, I don't feel like
I feel like there must be a much better way of expressing the following

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.