If you deal with files in your JavaFX app, then you need to have drag and drop integration. You’ll be amazed at how easy drag-and-drop is in JavaFX.
The following JavaFX image drag-and-drop example only takes three files. You can just copy them into your JavaFX project, and run them if you’d like.
The resulting application allows you to drag an image file onto your window. As the image file moves over the window, it will change in a OS specific way, indicating that you can drop the file onto the open window. Once you drop the image file on to the window, the image will be displayed in the window. Continue reading “JavaFX Drag and Drop Images”
JavaFX is all about graphics and drawing. Sure JavaFX can do great layouts, but if you need to visualize results, add images to layouts, or display data, JavaFX has all the tools you’ll need. Even games are written using JavaFX.
If you don’t know where to start learning JavaFX graphics capabilities, start with this tutorial. This tutorial explains how to draw JavaFX circles and squares after laying out your JavaFX UI using Scene Builder. It may not be glamorous, but it is a beginning. Continue reading “Drawing Squares and Circles in JavaFX”