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 6536061
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T10:26:48+00:00 2026-05-25T10:26:48+00:00

I have a LabelField nested within a TableLayoutManager row. I want the row to

  • 0

I have a LabelField nested within a TableLayoutManager row. I want the row to be a specific height (the same height as its bitmap background). In order to achieve this, I changed the layout() method of the nested LabelField:

LabelField lblHours = new LabelField(hours,
            Color.BLACK, Manager.FIELD_VCENTER) {
        protected void layout(int width, int height) {
            super.layout(width, 40 //height of the bitmap);
            setExtent(width, 40 //height of the bitmap);
        }
    };

This successfully increased the TableLayoutManager row size. However, once I do this, the LabelField is no longer centered vertically within the row. Any suggestions on how to do that?

Thanks!

  • 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-25T10:26:49+00:00Added an answer on May 25, 2026 at 10:26 am

    The above answer works just make sure that you put in two statements for the above.. as illustrated in the below example.

    LabelField importanceLabel = new LabelField("Importance: ",LabelField.FIELD_VCENTER | LabelField.FIELD_RIGHT) {
              public void paint(Graphics g) { 
                  g.setColor(0x145085); 
                  super.paint(g); 
              } 
              protected void layout(int width, int height) {
                  super.layout(Math.min(width, this.getFont().getAdvance(this.getText())), 26); //height of the bitmap);
                  setExtent(Math.min(width, this.getFont().getAdvance(this.getText())), 26); //height of the bitmap);
              }
          };
    

    This is going to be the same response.. and thank you guys.. for the discussion. It helped me.

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

Sidebar

Related Questions

I want to have a background image and being able to put LabelField ,
I create a new object. My new object will always have a labelField because
Basically, I have a button and on click it displays a menu. I want
i am developing app in Blackberry which have GPS Functionality. so first i want
I have an overridden LabelField that allows me to change the font color based
I have a combo box that is currently getting its information from a database
I have for fields in my datasource that I want to combine and display
I have a colorpicker that I want to have his colors loaded from an
I have a SharePoint edit form, where I want to make one of the
I have a flex pie chart: <mx:PieChart alpha=0.9 fontSize={QPieSeries_font} width=100% top=20 height=320 id=QPieChart dataProvider={dataObj}

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.