This discussion is archived
1 Reply Latest reply: Nov 2, 2012 8:38 AM by jsmith RSS

HBox problem

kapac Newbie
Currently Being Moderated
Hi;
how to make components at inegal distance between them in a hbox?
  • 1. Re: HBox problem
    jsmith Guru
    Currently Being Moderated
    I am going to guess that inegal means unequal.

    Use a padding style on the nodes is the HBox.
    For example:
    n1.setStyle("-fx-padding: 0, 5, 0, 0");
    n2.setStyle("-fx-padding: 0, 25, 0, 0");
    n3.setStyle("-fx-padding: 0, 15, 0, 0");
    There are other ways to do this too such as creating and adding spacer components, setting the minimum width of your nodes or using HBox static layout methods.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points