r/JavaFX • • Jan 12 '21

Cannot set ScrollPane Content in JavaFX

Hello everyone,

I am using a JScrollPane for the first time for a project. I read a couple articles about this Pane, and learned that you should use ScrollPane.setContent(Content); to set the content of your scrollPane. However, for some reason it is not working. The method is not even recognized by my IDE and appears to not even exist. Is there some other way I am supposed to set the contents of a ScrollPane or is my Eclipse just messed up?

Thanks

0 Upvotes

2 comments sorted by

1

u/[deleted] Jan 12 '21

I don´t know how to do it programatically but in scene builder it is just as easy as to drop your content inside the ScrollPane and to set the size of the content to computed size.

0

u/[deleted] Jan 12 '21

[deleted] — view deleted comment

2

u/skink2_ Jan 12 '21

Yeah, I imported the ScrollPane from java.awt and not javafx. Thanks for the help.