lookup JavaFX Tab - Java JavaFX

Java examples for JavaFX:TabPane

Description

lookup JavaFX Tab

Demo Code


//package com.java2s;

import javafx.scene.control.Tab;
import javafx.scene.control.TabPane;

public class Main {
    public static Tab lookupTab(final TabPane tabPane, final String text) {
        for (Tab tab : tabPane.getTabs()) {
            if (tab.getText().equals(text)) {
                return tab;
            }//from   w  w  w .j a  v  a 2  s .  co m
        }
        throw new IllegalArgumentException("TabPane " + tabPane
                + "doesn't contain tab with text " + text);
    }
}

Related Tutorials