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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T04:50:51+00:00 2026-06-15T04:50:51+00:00

I would expect setHorizontalAlignment to move my two buttons from the left over to

  • 0

I would expect setHorizontalAlignment to move my two buttons from the left over to the middle. Any idea why this is not working? All of the relevant code is below and pretty straightforward.

enter image description here

public void onClick(ClickEvent event) {
            final DialogBox deleteDialog = new DialogBox();
            deleteDialog.setModal(false);
            deleteDialog.setGlassEnabled(true);

            HorizontalPanel buttonPane = new HorizontalPanel();
            buttonPane.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_RIGHT);

            buttonPane.add(deleteDialogOKButton);
            buttonPane.add(deleteDialogCancelButton);

            deleteDialog.center();      

            deleteDialog.add(buttonPane);       
            deleteDialog.setText("Delete this Station?");

            deleteDialogOKButton.addClickHandler(new ClickHandler() {
                public void onClick(ClickEvent event) {
                    stationService.deleteStation(station, new DeleteStationCallback());
                    deleteDialog.hide();
                }});

            deleteDialogCancelButton.addClickHandler(new ClickHandler() {
                public void onClick(ClickEvent event) {
                    deleteDialog.hide();
                }});

            deleteDialog.show();
            //stationService.deleteStation(station, new DeleteStationCallback());
        }
    }
  • 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-15T04:50:52+00:00Added an answer on June 15, 2026 at 4:50 am

    When you don’t give any width to your horizontal panel, it takes up the sum of the width of its contents. So HasHorizontalAlignment.ALIGN_RIGHT, HasHorizontalAlignment.ALIGN_LEFT or any other alignment doesnot matter as its fitted in the given area. Try setting up the following,

    buttonPane.setwidth(100%);
    buttonPane.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTRE);
    

    If this also doesn’t work then you have to set cell alignment using the API

    setCellHorizontalAlignment(Widget w,HasHorizontalAlignment.HorizontalAlignmentConstant align);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This Ruby code is not behaving as I would expect: # create an array
This jQuery doesnt appear to be working as I would expect it to: $('#topic
This below does not seem to work how I would expect it, event though
I would expect that the regular expression ^[a-z]*$ would not match random$something However, this
I would expect this Java regex to match all text in between two parentheses:
I would expect there to be three lines of output from this code, but
One would expect that even though strings are immutable, value-equality and reference-equality would not
As you would expect from a DSL aimed at data analysis, R handles missing/incomplete
I would expect something like this to be pretty popular in demand but I
I would expect an error inside the copy constructor, but this compiles just fine

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.