I have a question about positioning Text into Bar area.
I created this example:
import javafx.application.Application;
import static javafx.application.Application.launch;
import javafx.scene.Scene;
import javafx.scene.control.Label;
import javafx.scene.layout.FlowPane;
import javafx.scene.layout.HBox;
import javafx.stage.Stage;
public class MainApp extends Application
{
@Override
public void start(Stage stage) throws Exception
{
FlowPane flow = new FlowPane();
flow.setPrefSize(900, 30);
Label label = new Label("Zoom 1.5");
Label labelStat = new Label("Users 7");
Label labelSec = new Label("Connected");
flow.getChildren().addAll(label, labelStat, labelSec);
HBox hb = new HBox();
hb.getChildren().add(flow);
Scene scene = new Scene(hb);
stage.setTitle("JavaFX and Maven");
stage.setScene(scene);
stage.show();
}
public static void main(String[] args)
{
launch(args);
}
}
How I can get this visual result:
In my case I want to resize the main stage and preserve the relative position of the Text. I can change FlowPane with different Layout if there is more suitable component.