title: JavaFX TabPane: How to set the selected tab
body: <p>I have a Java Desktop Application with JavaFX 2 in it and in my FX I've got a TabPane. I want to set the default tab. In other words I want to set a tab as selected. I found that there are multiple ways to find out which tab is selected and I found <code>setSelectionModel()</code> but I can't figure out how to use it.</p>
  
  <pre><code>TabPane tabPane = new TabPane();
  
  Tab tab0 = new Tab("blue");
  tab.setContent(new Rectangle(200,200, Color.BLUE));
  
  Tab tab1 = new Tab("green");
  tab.setContent(new Rectangle(200,200, Color.GREEN));
  
  tabPane.getTabs().addAll(tab0, tab1);
  </code></pre>