title: How can I do some action when one specific Tab is selected using Javafx
body: <p>I'm trying to do something when one tab of my tabPane is clicked, I've tried use Action Event but it doesn't work:</p>
  
  <pre><code>public void tabPressClicked (ActionEvent event){
          comboBoxPresYear.setVisible(true);
          lblPresYear.setVisible(true);
      }
  </code></pre>
  
  <p><strong>[EDITED]</strong></p>
  
  <p>The right way to do that:</p>
  
  <pre><code>tabPresentation.setOnSelectionChanged(new EventHandler&lt;Event&gt;() {
              @Override
              public void handle(Event t) {
                  if (tabPresentation.isSelected()) {
                      comboBoxPresYear.setVisible(true);
                      lblPresYear.setVisible(true);
                  }
              }
          });
  </code></pre>