get JavaFX Label Hbox - Java JavaFX

Java examples for JavaFX:HBox

Description

get JavaFX Label Hbox

Demo Code


//package com.java2s;

import javafx.scene.control.Label;
import javafx.scene.layout.HBox;
import javafx.scene.text.Font;
import javafx.scene.text.FontWeight;
import javafx.scene.text.Text;

public class Main {
    public static HBox getLabelHbox(String s1, String s2) {
        HBox hbox = new HBox();
        Label label = new Label(s1);
        label.setFont(Font.font("Tahoma", FontWeight.BOLD, 14));
        Text text = new Text(s2);
        hbox.getChildren().addAll(label, text);

        return hbox;
    }//  ww w  . ja  v  a 2s.  co m
}

Related Tutorials