doesn't really put the Button at the right of the HBox, it just puts 180 pixels of padding on the left, pushing the button further right.
The positioning of Nodes within the HBox is controlled by the alignment, so hb.setAlignment(Pos.TOP_RIGHT); would align the nodes to the right of the HBox when there is additional space.

i got a button at the right of the box
now i want to put a button at the left of the box.how can i proceed ?

HBox is not really designed for this. It will place nodes left to right in the order you add them. The overall alignment of the content is controlled by the HBox's alignment property. You can control the extent to which individual nodes receive extra space using HBox.setHgrow(), but not the positioning of individual nodes.

To have one button against the left edge of the HBox and one against the right edge, BorderPane and AnchorPane are better choices (which depends on what other content you may want). You could also nest two HBox inside another HBox, one with left alignment and one with right.