Java tutorial
//package com.java2s; //License from project: Open Source License import javafx.scene.control.Label; import javafx.scene.layout.Pane; public class Main { public static Label createLabel(String label, String cssClass, Pane parent) { Label l = new Label(label); l.getStyleClass().add("label-defaults"); l.getStyleClass().add(cssClass); parent.getChildren().add(l); return l; } }