0

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.

fabian
  • 80,457
  • 12
  • 86
  • 114
Volkeee
  • 93
  • 9
  • 3
    Did 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
  • 1
    The 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

0 Answers0