B4J Question jFX8Print on non Windows

madru

Active Member
Licensed User
Longtime User
Hi,

has somebody tested jFX8Print on a Mac or Linux?

I tried e.g B4XChartPrintText from Klaus and my own Apps, always the same result ...... all Apps do print on Windows (Java8)



Mac Error message:

java.lang.Exception: Stack trace
at java.base/java.lang.Thread.dumpStack(Thread.java:1379)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:199)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:167)
at jdk.internal.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:564)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:91)
at anywheresoftware.b4a.shell.ShellBA.raiseEvent2(ShellBA.java:98)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:78)
at anywheresoftware.b4j.objects.PaneWrapper$5.handle(PaneWrapper.java:153)
at anywheresoftware.b4j.objects.PaneWrapper$5.handle(PaneWrapper.java:1)
at javafx.base/com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:86)
at javafx.base/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:234)
at javafx.base/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:191)
at javafx.base/com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59)
at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
at javafx.base/com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
at javafx.base/com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:54)
at javafx.base/javafx.event.Event.fireEvent(Event.java:198)
at javafx.graphics/javafx.scene.Scene$MouseHandler.process(Scene.java:3856)
at javafx.graphics/javafx.scene.Scene.processMouseEvent(Scene.java:1851)
at javafx.graphics/javafx.scene.Scene$ScenePeerListener.mouseEvent(Scene.java:2584)
at javafx.graphics/com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:409)
at javafx.graphics/com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:299)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:391)
at javafx.graphics/com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleMouseEvent$2(GlassViewEventHandler.java:447)
at javafx.graphics/com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(QuantumToolkit.java:412)
at javafx.graphics/com.sun.javafx.tk.quantum.GlassViewEventHandler.handleMouseEvent(GlassViewEventHandler.java:446)
at javafx.graphics/com.sun.glass.ui.View.handleMouseEvent(View.java:556)
at javafx.graphics/com.sun.glass.ui.View.notifyMouse(View.java:942)
at javafx.graphics/com.sun.glass.ui.mac.MacView.notifyMouse(MacView.java:127)
at javafx.graphics/com.sun.glass.ui.mac.MacApplication._enterNestedEventLoopImpl(Native Method)
at javafx.graphics/com.sun.glass.ui.mac.MacApplication._enterNestedEventLoop(MacApplication.java:109)
at javafx.graphics/com.sun.glass.ui.Application.enterNestedEventLoop(Application.java:509)
at javafx.graphics/com.sun.glass.ui.EventLoop.enter(EventLoop.java:107)
at javafx.graphics/com.sun.javafx.tk.quantum.QuantumToolkit.enterNestedEventLoop(QuantumToolkit.java:635)
at javafx.graphics/com.sun.prism.j2d.print.J2DPrinterJob.showPrintDialogWithNestedLoop(J2DPrinterJob.java:239)
at javafx.graphics/com.sun.prism.j2d.print.J2DPrinterJob.showPrintDialog(J2DPrinterJob.java:210)
at javafx.graphics/javafx.print.PrinterJob.showPrintDialog(PrinterJob.java:300)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:564)
at anywheresoftware.b4j.object.JavaObject.RunMethod(JavaObject.java:132)
at b4j.example.printerjob._showprintdialog(printerjob.java:155)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:564)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:632)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:234)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:167)
at jdk.internal.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:564)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:91)
at anywheresoftware.b4a.shell.ShellBA.raiseEvent2(ShellBA.java:98)
at anywheresoftware.b4a.debug.Debug.delegate(Debug.java:64)
at b4j.example.printchart._print(printchart.java:179)
at b4j.example.printchart._initialize(printchart.java:137)
at b4j.example.configure._button2_click(configure.java:709)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:564)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:632)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:237)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:167)
at jdk.internal.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:564)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:91)
at anywheresoftware.b4a.shell.ShellBA.raiseEvent2(ShellBA.java:98)
at anywheresoftware.b4a.BA$1.run(BA.java:216)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:428)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:391)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:427)
at javafx.graphics/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:96)
at javafx.graphics/com.sun.glass.ui.mac.MacApplication._enterNestedEventLoopImpl(Native Method)
at javafx.graphics/com.sun.glass.ui.mac.MacApplication._enterNestedEventLoop(MacApplication.java:109)
at javafx.graphics/com.sun.glass.ui.Application.enterNestedEventLoop(Application.java:509)
at javafx.graphics/com.sun.glass.ui.EventLoop.enter(EventLoop.java:107)
at javafx.graphics/com.sun.javafx.tk.quantum.QuantumToolkit.enterNestedEventLoop(QuantumToolkit.java:635)
at javafx.graphics/javafx.stage.Stage.showAndWait(Stage.java:465)
at anywheresoftware.b4j.objects.Form.ShowAndWait(Form.java:232)
at b4j.example.configure$ResumableSub_open.resume(configure.java:265)
at anywheresoftware.b4a.shell.DebugResumableSub$DelegatableResumableSub.resumeAsUserSub(DebugResumableSub.java:47)
at jdk.internal.reflect.GeneratedMethodAccessor8.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:564)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:632)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:237)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:167)
at jdk.internal.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:564)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:91)
at anywheresoftware.b4a.shell.ShellBA.raiseEvent2(ShellBA.java:98)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:78)
at anywheresoftware.b4a.shell.DebugResumableSub$DelegatableResumableSub.resume(DebugResumableSub.java:42)
at anywheresoftware.b4a.BA.checkAndRunWaitForEvent(BA.java:136)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:85)
at anywheresoftware.b4a.shell.ShellBA.raiseEvent2(ShellBA.java:98)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:78)
at anywheresoftware.b4a.keywords.Common$3.run(Common.java:1086)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:428)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:391)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:427)
at javafx.graphics/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:96)

Linux Error message:

java.lang. RuntimeException: java.lang.unetob
at anywheresoftware.b4a.BA.raiseEvent2(BA. java:12
at anywheresoftware.b4a.BA$1.run(BA. java:216)
at com.sun.javafx.application.PlatformImpl.lambda$null$117(PlatformImpl.java:295)
at java.security.AccesControl.rvvd
at com.sun.javafx.application.platformImpl.lambda$runLater$118(PlatformImpl.java:294)
at com.sun.glass.ui. InvokeLateDispat$ur
at com.sun.glass.ui.gtk.GtkApplication.enterNestedEventLoopImpl(Native Method)
at com.su.glass.ui.gtk.GtkAppli._ee j
at con.sun.glass.ui.Application.enterNestedEventLoop(Application.java:511)
at com.sun.glass.ui.EventLoop.enter(EventLoop.java:107)
at com.sun.javafx.tk.quatum.Quakie
at javafx.stage.Stage.showAndWait(Stage.java:474)
at anywheresoftware.b4j.objects.Form.ShowAndWwait(Form.java:232)
at b4j.example.configure$ResumableSub_open.resume(configure.java:6375)
at anywheresoftware.b4a.BA.checkAndRunWaitForEvent(BA.java:136)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:85)
at anywheresoftware.b4a.BA.raisevet(. java:78)
at anywheresoftware.b4a.keywords.Common$3.run(Conmon.java:1086)
at com.sun.javafx.application.platformImpl.lambda$null$117(PlatformImpl.java:295)
at java.securty.AccessControl.rh))
at com.sun.javafx.application.platformImpl.lambda$runLater$118(PlatformImpl.java:294)
at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
at com.sun.glass.ui.gtk.GtkAppl._t
at com.sun.glass.ut.gtk.GtkApplication.lambda$null$450(GtkApplication.java:139)
at java.lang.Thread.run(Thread. java:748)
Caused by: java.lang.untimeException: Object should first be ii⅗ec
at anywheresoftware.b4a.Abs0bjectWrapper.getobject(Abs0bjectWrapper.java:32)
at anywheresoftware.b4j.object.Java0bject.getcurrentclass([email protected]:259)
at anywheresoftware.b4j.object.Java0 .Runetv
at b4j.example.printerjob._showprintdialog(printerjob.java:155)
at b4j.example.printchart._print(printchart.java:149)
at b4j.example.printchart._initialize(printchart.java:136)
at b4j.example.configure._button2_click(configure.java:188)
at sun.reflect.NativeMethdAcc1.oktivee
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl. NativeMethodAcessor.k(r)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at anywheresoftware.b4a.BA.raiseven2(. java:91)
24 more
 
Last edited:

stevel05

Expert
Licensed User
Longtime User
I haven't tested on a Mac, but do you have a printer installed on the linux PC? Maybe the same issue for both.

I get a similar error without a printer defined on Ubuntu. Add a printer and it works as expected.

To catch this issue test that the printer job is initialized before calling any methods on it especially when you get the default printer, which may or may not be there.
 
Last edited:
Upvote 0

madru

Active Member
Licensed User
Longtime User
ok, you are right. it must be a real printer, a virtual device does not work.

but.... on Linux and OSX the print dialog appears again after you press print in the dialog. Can you confirm?
 
Upvote 0

stevel05

Expert
Licensed User
Longtime User
I installed a PDF printer (Generic CUPS-PDF Printer) and it worked so some virtual printers are OK, which one are you trying?

No I don't get the print dialog a second time. Can you upload an example?
 
Upvote 0
Top