/* * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. */ import javafx.application.Application; import javafx.scene.SceneBuilder; import javafx.scene.layout.VBoxBuilder; import javafx.scene.text.TextBuilder; import javafx.stage.Stage; import javafx.stage.StageBuilder; /** * * @author Alexander Kouznetsov */ public class Bug extends Application { public static void main(String[] args) { launch(args); } @Override public void start(Stage stage) throws Exception { StageBuilder.create() .scene(SceneBuilder.create() .stylesheets("Bug.css") .root(VBoxBuilder.create() .children( TextBuilder.create() .text("Just text") // .styleClass("text") // <- This is workaround .build(), TextBuilder.create() .text("Text with id") .id("text") .build() ) .build()) .build()) .applyTo(stage); stage.show(); } }