Skip Navigation

Printing from JavaFX

coderscratchpad.com JavaFX Printing: Generating and Printing Reports and Documents

Master JavaFX Printing: Create, and print reports/documents seamlessly. Enhance your desktop app's functionality now! #JavaFX #Printing

JavaFX Printing: Generating and Printing Reports and Documents

Over the years, I've seen a lot of people ask, "How can I print this TableView?", or some other similar question. I've always thought this was a bit silly, a TableView is a screen thing (or a VBox, or whatever), and printing it doesn't make much sense.

Most of the answers I've seen to these questions are along that line - printing is a data-centric thing and you should do it from the back-end as it has nothing to do with your GUI.

But it turns out that JavaFX does have classes designed to enable printing of screen layouts! Go figure.

Edward Stephen Jr. has an new article out introducing the concept. I think it's worth a read.

I still don't know what happens if you print a TableView, but at least there is a way to find out.

0
0 comments