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

public class TabPaneTest extends Application {

    private static final int NUM_TABS = 40;

    @Override
    public void start(Stage primaryStage) throws Exception {
        Scene scene = new Scene(createTabPane(), 400, 300);
        primaryStage.setScene(scene);
        primaryStage.show();
    }

    private TabPane createTabPane() {
        TabPane tabPane = new TabPane();
        for (int i = 0; i < NUM_TABS; ++i) {
            final Tab tab = new Tab(Integer.toString(1000 + i));
            tabPane.getTabs().add(tab);
        }
        return tabPane;
    }

}
