I've been trying to find something on the web but was unable to find anything that can help me with my issue.
I need to send content of JFXTreeTableView
to printer to print it. Any help appreciated. I can even use ArrayList<Object>
as a data source to print so don't stick to the table.
Asked
Active
Viewed 134 times
0
-
3Did you try googling something like "java print to printer"? You can start with [this tutorial](https://docs.oracle.com/javase/tutorial/2d/printing/index.html). – Code-Apprentice Apr 09 '18 at 15:20
-
What's your operating system, printer make and model, and driver version? You need to send a file to the printer through the OS in Java, as far as I know. – manglano Apr 09 '18 at 15:22
-
1The JavaFX print API only allows you to print `Node`s not `Object`s. You didn't post info about ***how*** you want to print the data so this question is not really answerable. If you want to print the whole `JFXTreeTableView` though, there should be plenty examples available. – fabian Apr 09 '18 at 15:22
-
@fabian it doesn't matter how. I have a JFXTreeTableView from JFoenix library and a whole bunch of DAO classes. I need to print the data somehow in any way possible to just have it on a paper. – Volkeee Apr 09 '18 at 15:33
-
There's a code snippet in the javadoc: https://docs.oracle.com/javase/9/docs/api/javafx/print/PrinterJob.html You have to deal with the virtualisation of `JFXTreeTableView` and potentially non-expanded items though. – fabian Apr 09 '18 at 15:38