import javafx.application.Application; 
import javafx.scene.Scene; 
import javafx.scene.control.Label; 
import javafx.scene.control.Tab; 
import javafx.scene.control.TabPane; 
import javafx.stage.Stage; 

import java.net.URL; 

public class FXTabPaneTest extends Application { 

  public static void main(String[] args) { 
    launch(); 
  } 

  @Override 
  public void start(Stage primaryStage) throws Exception { 
    TabPane tabPane = new TabPane(); 

    URL url = getClass().getResource("TabPaneStyle.css"); 
    tabPane.getStylesheets().add(url.toExternalForm()); 

    Label label = new Label("SomeText"); 
    tabPane.getTabs().add(new Tab("Text", label)); 

    primaryStage.setScene(new Scene(tabPane, 300, 300)); 
    primaryStage.show(); 
  } 
} 