JavaFX is heavily promoted as a desktop technology to replace Swing. So it might seem slightly strange to suggest running it on a server. But JavaFX also offers a replacement for Graphics2D. We use Graphics2D extensively for creating images from PDF data. One of the popular uses for our Java PDF library is to convert PDF files to images on the server. Currently we use Graphics2D for this. So can you use JavaFX on your server, and how well does it run?
Reasons to use JavaFX in place of Graphics2D
We have found 3 reasons to use JavaFX:-
1. More Functionality. JavaFX offers a much more polished set of functions that Graphics2D. As an example, General shapes and paths have much more functionality in JavaFX and you do not need to convert them to Areas,
2. Less code. We have found that our JavaFX implementations have much less code than Graphics2D. This is partly because the API is better designed and partly because JavaFX has more functionality. My colleague Simon has a really interesting blog article on how much simpler blend modes are in JavaFX.