JavaFX - GridPane Background Image

Alexander Falk

I've been searching around the internet, and I still haven't found a solution.

All I want to do is: Set an image to my GridPane in a POPUP-window, that I've made, when a button is clicked.

Some programmers refers to:

grid.setStyle("-fx-background-image: url('URL')");

Which were my suggestion as well, but it does not seem to work. I've also tried to set Image image = new Image(); and then set an ImageView, but with no luck!

Hope someone in here has a quick fix for this answer.

Alexander Falk

//root.setStyle("-fx-background-image: url('https://encrypted-tbn1.gstatic.com/images?q=tbn:ANd9GcQxsasGQIwQNwjek3F1nSwlfx60g6XpOggnxw5dyQrtCL_0x8IW')");

This worked out. But not all url's it likes.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related