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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T03:30:38+00:00 2026-06-08T03:30:38+00:00

I have quite a big button ( minWidth and minHeight were explicitly set to

  • 0

I have quite a big button (minWidth and minHeight were explicitly set to big numbers), and inside that big button there is relatively small icon and some text. Icon and text do not consume all available space, and end up being placed in the center of the button.

I want to put icon and text to the left side of the button. But it seems that I do not understand what all those alignments mean, since setting alignment to BASELINE_LEFT or setting textAlignment to LEFT didn’t change anything.

How can I fix it?

  • 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-08T03:30:41+00:00Added an answer on June 8, 2026 at 3:30 am

    Property textAlignment controls alignment for multiline text so it wouldn’t help you.

    But both

     btn.setStyle("-fx-alignment: LEFT;");
    

    or

     btn.setAlignment(Pos.BASELINE_LEFT);
    

    should work for you. See example below.

    enter image description here

    public class ILoveBigButtonsAndICannotLie extends Application {
    
        @Override
        public void start(Stage primaryStage) {
            Button btn = new Button();
            btn.setText("Button");
            btn.setGraphic(new Rectangle(10,10, Color.RED));
            btn.setMinHeight(200);
            btn.setMinWidth(250);
            //btn.setStyle("-fx-alignment: LEFT;");
            btn.setAlignment(Pos.BASELINE_LEFT);
    
            StackPane root = new StackPane();
            root.getChildren().add(btn);
            primaryStage.setScene(new Scene(root, 300, 250));
            primaryStage.show();
        }
    
        public static void main(String[] args) { launch(); }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have quite big document in html format that generated from Microsoft Word. It
I am refurbishing a big CMS that I have been working on for quite
I have quite a big table (about 4M of entries) for emails that are
I have images that will be quite big in dimension and I want to
I've started playing around with transitions and have come up against quite a big
I have quite a complex piece of code (JQuery and HTML5 Web SQL) that
I have quite a big amount of fixed size records. Each record has lots
I have quite a big network in a CSV file. It containt 450k nodes
I seem to have a bit of a problem here that I can't quite
i have quite big ASP.NET MVC 2 application (multiple areas, each with own routing

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.