How to do: "Plain Text - Link "

I do:

Hyperlink hyperlink = new Hyperlink("Ссылка"); Label label = new Label("Простой текст - "); Pane pane = new Pane(); pane.getChildren().addAll(label,hyperlink); bottomBorderPane.setCenter(pane); 

But in the end, hyperlink and label are displayed on top of each other, and still not in the center of the bottomBorderPane, but on the left ...

  • Try using a TextFlow container. - lampa
  • bottomTextFlow.getChildren (). addAll (label, hyperlink); Brought normally, just how to make it display the contents in the center? not on the left ... - Vitaly M.

2 answers 2

 Hyperlink hyperlink = new Hyperlink( "Ссылка" ); Label label = new Label( "Простой текст - " ); HBox hBox = new HBox(); hBox.setAlignment( Pos.CENTER ); hBox.getChildren().addAll( label, hyperlink ); //далее вставляем куда угодно bottomBorderPane.setCenter( pane ); 
  • Thank you - what you need! - Vitaly M.

Pane is a generic class with basic layout. Use StackPane.

  • bottomStackPane.getChildren (). addAll (label, hyperlink); the same one over the other ... - Vitaly M.
  • label.setAlignment (Pos.CENTER_LEFT); hyperlink.setAlignment (Pos.CENTER_RIGHT); - alex
  • All the same superimposed on each other. - Vitaly M.