cgange background from button click java fx

Solutions on MaxInterview for cgange background from button click java fx by the best coders in the world

showing results for - "cgange background from button click java fx"
Giada
11 Apr 2016
1BackgroundImage backgroundImage = new BackgroundImage( new Image( getClass().getResource("/testing/background.jpg").toExternalForm()), BackgroundRepeat.NO_REPEAT, BackgroundRepeat.NO_REPEAT, BackgroundPosition.DEFAULT, BackgroundSize.DEFAULT);
2        Background background = new Background(backgroundImage);
3
4        Button button = new Button( "Click me!");
5        button.setBackground(background);