This can be done by adding -fx-padding: -10 0 0 0;to your styles list.
For a more flexible solution, you can use the information FontMetrics:
FontMetrics metrics = Toolkit.getToolkit().getFontLoader().getFontMetrics(label.getFont());
label.setPadding(new Insets(-metrics.getDescent(), 0, 0, 0));
NB: You need to call this code after scene.show(). Prior to this, the graphics engine is not ready to provide the correct indicators.
source
share