JavaFX Dialogs, Anyone?

Guest Author
A common question about JavaFX, especially for those coming from a Swing background, is "How do I do Dialogs?"

The reason this is a question at all is that, currently, there is no baked-in capability to do dialog boxes within a pure JavaFX 2.x application. But come on...you wouldn't be reading about this at all if you weren't a resourceful programmer. You have ways of making things happen.  :-)

I ran across a decent patch of code recently that handles many of the dialog chores for you. Pros and cons follow, but pointing your browser to this link on Github (appropriately named JavaFXDialog) will get you off to a good start.

Here are some screen shots the original code author, Anton Smirnov, provided:

Nothing fancy, just clean and functional. Now, about those pros and cons. From my perspective, here's the bottom line:


  • Already developed. Time required to implement is limited to downloading and decompressing the file, doing a bit of reading, and writing a few lines of code to try things out.
  • Easy. Most of the work is done, and the interface is pretty simple.
  • Open source. If you want to make changes - and I'm already thinking along those lines, so you may as well admit you will, too - you can do it.


  • Documentation. What you see on the Wiki page is the extent of it.
  • Lack of activity. As of the date this article was published, the code hasn't been updated in several months...so the project is a bit stale.
To be fair, the cons listed above won't cause anyone to lose sleep. After all, you don't expect constant revisions against something that works well enough for most purposes, and if your needs exceed what is there, it's easy to mod the code yourself or "roll your own" if you prefer. The lack of documentation isn't a show-stopper either due to the limited functionality and complexity of the code.

Wrapping It Up

If you need a quick, drop-in dialog capability for your JavaFX 2.x app, give it a try and see what you think. And if you're already using something you like, please share it as well! I'd love to hear from you, take a look at what you pass along, and maybe do a "dialog shoot-out" article in the future. So..what works for you?  :-)

All the best,


Join the discussion

Comments ( 2 )
  • Anil Wednesday, March 27, 2013

    I tried this out - a boon. Unfortunately, the icons don't display at all. Tried opening in a graphics editor, they seem corrupted.

  • Mark Heckler Wednesday, March 27, 2013

    Hi Anil,

    Thanks for the compliment. I used the same icon files for DialogFX and MonologFX; would you try to re-download them from my GitHub page(s)? Perhaps they were corrupted somehow in the earlier download, especially if a graphics editor also can't read them...

    If that doesn't work, I can email you a .zip file of the icons. Just let me know.

    All the best,


Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.