Java FlowPane.getContentBias()

Syntax

FlowPane.getContentBias() has the following syntax.

public Orientation getContentBias()

Example

In the following code shows how to use FlowPane.getContentBias() method.


import javafx.application.Application;
import javafx.geometry.Orientation;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.layout.FlowPane;
import javafx.stage.Stage;
//from   w w w  . j  a v  a 2  s .  co m
import javax.swing.GroupLayout.Alignment;

public class Main extends Application {
  public static void main(String[] args) {
    Application.launch(args);
  }

  @Override
  public void start(Stage primaryStage) {
    FlowPane flowPane = new FlowPane(Orientation.HORIZONTAL,20,20);
    flowPane.setPrefWrapLength(210);                 
    Button btn = new Button();
         
    for(int i=0; i<8; i++){
      btn = new Button("Button");
      btn.setPrefSize(100, 50);
      flowPane.getChildren().add(btn);
    }    
    System.out.println(flowPane.getContentBias());
    
    Scene scene = new Scene(flowPane);
    primaryStage.setScene(scene);
    primaryStage.show();
  }
}




















Home »
  Java Tutorial »
    javafx.scene.layout »




BorderPane
FlowPane
HBox
TilePane
TitledPane
VBox