How can stretch a background image for the label?

Hi all
How can I stretch a background image in a label?
 public void start(final Stage primaryStage) {
             final Label lbTest = new Label("My Test Label");
             lbTest.setAlignment(Pos.CENTER);
             lbTest.setTextAlignment(TextAlignment.CENTER);
             lbTest.setStyle("-fx-background-color:red;-fx-background-repeat:stretch;-fx-background-position:center top;-fx-background-image:url(\"http://upload.wikimedia.org/wikipedia/commons/thumb/1/1c/BlueMarble-2001-2002.jpg/640px-BlueMarble-2001-2002.jpg\");");
             final HBox hbox = new HBox();
             hbox.setId("MyRootPane");
             Button btnLeft=new Button("Left Button");
             Button btnRight=new Button("Right Button");
             hbox.getChildren().addAll(btnLeft,lbTest,btnRight);
             final StackPane layout = new StackPane();
             layout.getChildren().add(hbox);
             Scene scene = new Scene(layout, 600, 320);
             lbTest.prefWidthProperty().bind(scene.widthProperty());
             lbTest.prefHeightProperty().bind(scene.heightProperty());
             primaryStage.setScene(scene);
             primaryStage.show();
    }
This code does not work, if I deleted css - fx-background-repeat: stretching; the tense but background image he repeated, I want to leave the background image stretched and not repeated, it can be extended with the window resizing automatically.

Try - fx-background-size: stretch;

Tags: Java

Similar Questions

Maybe you are looking for

  • My Qosmio F60 graphics card crashes often

    Hi guys. Hoping for some advice/corrections. I now have a F60 for about three weeks.The thing is great with the exception of a significant drawbacks. The screen will either sometimes go to pieces then turn black and then turns back on nothing similar

  • Graphic resolution Equium L100 186

    It is a new satellite L100-186, I installed Win XP Proffesional. I am steel not shore-style witch it is, because the toshiba Web page, it gives me series two options L10 and L20, but readers for the L10 will not work but works of L20? In any case, I

  • CLIQ 2.1: email notification

    does anyone else have a boring song as they are notified by email after the update? so annoying! I was trying to sleep and he kept playing. I was too tired to understand what it was, so I turned my phone off and studied this morning.

  • OE6 compacting emails, three months have disappeared. How to open the archive.pst file?

    Using Windows XP and OE6. I want to open the folder to archive and get the messages back to my Inbox.

  • 'C0000005' exception Access Violation error when I open application of embroidery

    In order to open my application of embroidery (which is used to run), I get the following: Exception code: C0000005 Exception flags: 0 The exception address: 00614ED8 Number of settings: 2 Start address: 0048CA 00 Exception offset: 001884DB What can