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

  • SEARCH
  • Home
  • 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 8512459
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T04:17:11+00:00 2026-06-11T04:17:11+00:00

I have a TabLayoutPanel where I am putting custom widgets in for the tabs

  • 0

I have a TabLayoutPanel where I am putting custom widgets in for the tabs to be able to display some images next to the text. I originally worked with TabPanel and using custom HTML for the tab text, but custom tab widgets allows me to modify the image on the fly as needed.

My tab widget is essentially a HorizontalPanel, a number of small images, and a line of text. The problem I’m having is that the tab doesn’t want to stick to the bottom of the tab bar like normal. The tab is getting positioned at the top of the space reserved for the tab bar, and there’s a gap between it and the bottom of the tab bar. I uploaded an image of the problem to http://imgur.com/fkSHd.jpg.

Is there some style that I need to apply to custom widget tabs to make them appear correctly?

  • 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-06-11T04:17:13+00:00Added an answer on June 11, 2026 at 4:17 am

    After a bit more research, I found the answer here: https://groups.google.com/d/msg/google-web-toolkit/mq7BuDaTNgk/wLqPm5MQeicJ. I had to use InlineLabel or InlineHTML widgets instead of normal Label or HTML widgets. I’ve tested this solution and it does exactly what I want. I pasted the code of the class below for completeness. Note two things here:

    1. The “float” attribute cannot be set on the last element (the InlineLabel) or the incorrect drawing condition occurs again.
    2. The code could be cleaned up a bit further by having the class extend directly from FlowPanel instead of making it a composite containing a FlowPanel.

      package com.whatever;
      
      import com.google.gwt.core.client.GWT;
      import com.google.gwt.dom.client.Style.Float;
      import com.google.gwt.dom.client.Style.Unit;
      import com.google.gwt.resources.client.ClientBundle;
      import com.google.gwt.resources.client.ImageResource;
      import com.google.gwt.user.client.ui.Composite;
      import com.google.gwt.user.client.ui.FlowPanel;
      import com.google.gwt.user.client.ui.Image;
      import com.google.gwt.user.client.ui.InlineLabel;
      
      public class StatusTab extends Composite
      {
         public interface StatusImages extends ClientBundle
         {
            public static StatusImages instance = GWT.create(StatusImages.class);
      
            @Source("images/status-green.png")
            ImageResource green();
      
            @Source("images/status-red.png")
            ImageResource red();
         }
      
         private final ImageResource greenImage;
         private final ImageResource redImage;
      
         private final FlowPanel flowPanel;
      
         public LinkStatusTab(String text, int numStatuses) {
      
            greenImage = StatusImages.instance.green();
            redImage = StatusImages.instance.red();
      
            flowPanel = new FlowPanel();
            initWidget(flowPanel);
      
            for (int i = 0; i < numStatuses; i++)
            {
               Image statusImg = new Image(redImage);
               statusImg.getElement().getStyle().setMarginRight(3, Unit.PX);
               statusImg.getElement().getStyle().setFloat(Float.LEFT);
               flowPanel.add(statusImg);
            }
      
            flowPanel.add(new InlineLabel(text));
         }
      
         /**
          * Sets the image displayed for a specific status entry.
          */
         public void setStatus(int which, boolean status)
         {
            Image image = (Image)flowPanel.getWidget(which);
            if (status)
               image.setResource(greenImage);
            else
               image.setResource(redImage);
         }
      }
      
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Currently, I have a TabLayoutPanel with a few tabs, inside of each tab is
I have a trivial TabLayoutPanel made with a UIBinder. The tabs render but none
I have a layout in Google Web Toolkit using UIBinder involving a TabLayoutPanel .
I have a project in which I need a way to display essentially a
I'm making some controls which all have to share the same look and some
Have one Doubt In MVC Architecture we can able to pass data from Controller
So I have a form with some tab objects, group objects and possible a
Have a text box which get data for price. If someone enter something like
I'd like to implement a custom TabLayoutPanel which would automatically setup the tab itself
Have some runtime defined schedule for one week, for example: <schedule> <s day=Monday, time=1:00:00></s>

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.