Note that there are some explanatory texts on larger screens.

plurals
  1. POWorkaround for printing in JavaFX
    primarykey
    data
    text
    <p>Ok, so I've actually completed my program in JavaFX and everything is working nicely, but I have two reports that I need to be able to print, and wouldn't you know it? JavaFX doesn't support printing!</p> <p>I've been trying to work around this by way of making a JFrame that imports all the data from JavaFX, but it keeps NOT displaying the JFrame and giving me the following error:</p> <p>2013-07-25 16:58:05.334 java[2150:707] [JRSAppKitAWT markAppIsDaemon]: Process manager already initialized: can't fully enable headless mode.</p> <p>I assume this happens because the same instance of JRE can't run FX and display a Swing JFrame at the same time? Because the same code WILL work if run on it's own (just doesn't have the data from the FX app to display in the reports).</p> <p>So my question is, is there a workaround that does not entail me re-writing all my FX code to Swing? The printer being used is a generic/text only dot matrix printer, so I was trying to import the data to the JFrame because then it would be easy to print the entire frame of text. Perhaps my JFX report generator could open the JFrame in a new JRE? or is there a way to get it to work in the same JRE? I <em>do</em> need it to be seamlessly integrated into the existing system so the user can generate the report from the JFX GUI and have it print automatically rather than generate the report, then go to another (Swing) GUI to print it.</p> <p>Help!</p> <p>Ok, so I tried the suggested answer of using the beta release of Java 8, but now nothing works. I get the following error:</p> <p>Exception in thread "main" java.lang.UnsupportedClassVersionError: com/javafx/main/Main : Unsupported major.minor version 52.0 at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:791) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) at java.net.URLClassLoader.defineClass(URLClassLoader.java:449) at java.net.URLClassLoader.access$100(URLClassLoader.java:71) at java.net.URLClassLoader$1.run(URLClassLoader.java:361) at java.net.URLClassLoader$1.run(URLClassLoader.java:355) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:354) at java.lang.ClassLoader.loadClass(ClassLoader.java:423) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308) at java.lang.ClassLoader.loadClass(ClassLoader.java:356) at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:482) Java Result: 1</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload