change JavaFX Label Font Size - Java JavaFX

Java examples for JavaFX:Label

Description

change JavaFX Label Font Size

Demo Code


//package com.java2s;

import javafx.scene.control.Labeled;

import javafx.scene.text.Font;

public class Main {
    public static void changeFontSize(Labeled node, int change) {
        node.setFont(new Font(node.getFont().getName(), Font.getDefault()
                .getSize() + change));/*from   ww  w. j ava2s . co m*/
    }
}

Related Tutorials