Updating printers while application is running?
Tobias Oelgarte
tobias.oelgarte at gmail.com
Tue Jun 7 18:39:21 UTC 2022
Is there some way to update the ObservableSet of Printers once the
Application is running? Calling Printer.getAllPrinters() always returns
the same OberservableSet and it does not change - ever. [1]
We have an JavaFx based application running under Windows 10/11 that is
used to print on wireless printers, that are not always available.
Having to restart the the application every time a printer goes away or
comes available is a serious pain for the users.
Is there any kind of workaround?
I doubt it will be fixed in the near future, since this comment is from
6 years ago [2]:
// This is static. Eventually I want it to be dynamic, but first
// it needs to be enhanced to only create new instances where
// there really has been a change, which will be rare.
[1]
https://stackoverflow.com/questions/38470568/javafx-doesnt-detect-changes-of-available-printers
[2]
https://github.com/openjdk/jfx/blob/master/modules/javafx.graphics/src/main/java/com/sun/prism/j2d/PrismPrintPipeline.java#L99
More information about the openjfx-dev
mailing list