I ask for your help because I have a problem with a ScrollPane in JavaFX.
I added a Group into the scrollPane, added the scrollpane to the Scene and finally put it into a JFXPanel because I use it in a Swing application and it's working well, next I added components into the Group (by components I mean an assembly of Nodes like Rectangles, etc ...). That works well, but when I want to move a component out of the scrollpane layout, the movement of the components is uncontrollable, it starts moving really fast and I don't understand why. It starts troubling just when the border of the component touch the border of the scrollpane layout. I tried to use ScrollBar instead but it seems that the ScrollPane is the most suitable object for this.
There is the code I used to create my view :
public void createView() {
this.architectureJFXPanel = new JFXPanel();
this.group = new Group();
this.scrollPane = new ScrollPane();
this.scrollPane.setContent(group);
this.scrollPane.setOnKeyPressed(new KeyPressed());
Platform.runLater(new Runnable() {
@Override
public void run() {
Scene scene = new Scene(scrollPane, Color.WHITE);
architectureJFXPanel.setScene(scene);
}
});
}
To put the components into the view I use group.getChildren.add()
and after that I put the JFXPanel into the swing application.
Here is an example of what I'm trying to do. You can see that on the picture I try to move the component out of the layout:
So if someone already had this kind of problem and could help me I would be really greatful :) Ask me if you need more informations to understand where is the problem.