JavaFX – Drag and Drop

JavaFX does not support Drag-n-Drop by default. But we can wrap javafx Node in a SwingComponent so as to support this feature.

In below applet the list of products is obtained using Yahoo Product Search API. Each of the thumbview is wrapped around a swing component which supports drag and drop. User can drag the product and drop it on to shopping-cart. Once the shopping is complete, user can click on “green arrow” so as to check-out. A list of item bought by user is shown. Click on list to go back to shopping mode.