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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T01:10:17+00:00 2026-06-01T01:10:17+00:00

I am having problem to set label at right corner in ToolBar . Hear

  • 0

I am having problem to set label at right corner in ToolBar.

Hear is piece of code please check it.

public class CustomGrid extends ContentPanel {

    private final Grid<ContentItem> grid ;

    public CustomGrid() {
        setHeaderVisible(false);
        setBodyBorder(false);
        setBorders(false);
        setHeaderVisible(false);
        setCollapsible(true);
        setLayout(new FitLayout());

        /* Code...... */

           LabelToolItem item = new LabelToolItem();
           item.setLabel("0 Rows Selected..");

           ToolBar toolbar = new ToolBar();
           toolbar.setAlignment(HorizontalAlignment.RIGHT);
           toolbar.add(item);
           setTopComponent(toolbar);

           add(grid);

    }
    }

in above code toolbar displays label in center.

if i give toolbar.setAlignment(HorizontalAlignment.LEFT); than it display at left corner but, while i give toolbar.setAlignment(HorizontalAlignment.RIGHT); it displays at center. what should i do?, i missing something?

please help me.

  • 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-01T01:10:18+00:00Added an answer on June 1, 2026 at 1:10 am

    I had a similar problem trying to right-align a Button in a HorizontalPanel. The solution was to pack the button into a cell and set the align_right on the cell.

    <g:HorizontalPanel ...>
       ...
       <g:cell horizontalAlignment="ALIGN_RIGHT" width="100">
          <g:Button ui:field="j_logout" text="Log out" width="90%"/>
       </g:cell>
    </g:HorizontalPanel>
    

    Another solution might be calling addFill() on the Toolbar before adding the elements that should go right.

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

Sidebar

Related Questions

I'm having trouble right aligning a label. I set the TextAlign to MiddleRight, yet
I am having a problem accessing the ViewData object through javascript. I have set
I'm having an unusual problem with an IE document with contentEditable set to true.
I'm having an annoying problem with my iPhone app. Whenever I set the optimization
Having a bit of a problem, Due to the source-control set-up we use, each
Here's the problem I'm having, I've got a set of logs that can grow
I have included my two code sources below. The problem that I am having
I'm having a problem with adding MouseListeners to a set number of Jlabels that
I'm having a really strange problem. Here is the code I have that should
I'm having problems with Iterator.remove() called on a HashSet. I've a Set of time

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.