import javafx.application.Application;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.control.Tab;
import javafx.scene.control.TabPane;
import javafx.stage.Stage;


public class TabTest extends Application {

    public Parent createContent() {

        TabPane p = new TabPane();
        p.setPrefSize(300, 150);
        p.setMinSize(TabPane.USE_PREF_SIZE, TabPane.USE_PREF_SIZE);
        p.setMaxSize(TabPane.USE_PREF_SIZE, TabPane.USE_PREF_SIZE);

        for (int i = 0; i < 20; i++) { p.getTabs().add(new Tab("tab-" + i)); }
        return p;
    }

    @Override public void start(Stage primaryStage) throws Exception {

        primaryStage.setScene(new Scene(createContent()));
        primaryStage.show();
    }

    public static void main(String[] args) { launch(args); }
}
