Drag-and-Drop, how to drag the element itself?

Hi, i'm novice at JavaFX and i'm little bit confused. The situation: I have the main HBox container with two VBoxes in it. In the first VBox i have an element, another VBox (Let's say - card element). The question: How can i make this card element between 2 VBoxes (i mean - this element needed to be snaped to the mouse cursor until it's droped)? Example on the screen (not my work, just found the demo) Pls, help me. :boohoo:
No description
5 Replies
JavaBot
JavaBot3d ago
This post has been reserved for your question.
Hey @Like a G҉ ˢᵉˣ! Please use /close or the Close Post button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically marked as dormant after 300 minutes of inactivity.
TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.
dan1st
dan1st2d ago
HBox/VBox doesn't really allow that because these always position elements next to/on top of each other For drag and drop like that, you need something like AnchorPane that allows you to reposition stuff using coordinates you could try to either put the HBox in an AnchorPane and move the element to drag out of the VBox and onto the AnchorPane while dragging or you replace the HBox by an AnchorPane
JavaBot
JavaBot2d ago
💤 Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived. If your question was not answered yet, feel free to re-open this post or create a new one. In case your post is not getting any attention, you can try to use /help ping. Warning: abusing this will result in moderative actions taken against you.
Like a G҉ ˢᵉˣ
Oh, really. That was the problem 😕. Thx for advice. It helped a lot 👍
JavaBot
JavaBot2d ago
Post Closed
This post has been closed by <@527594177144291328>.

Did you find this page helpful?