B4J Question GDK - Warning ???

rspitzer

Active Member
In debug mode when using the crop command, in the log screen I get the following warning:

Code to generate GDK warning:
temp_image = temp_image.crop(cip.saved_image_x,cip.saved_image_y,cip.saved_image_blocklength,cip.saved_image_blockwidth)

GDK waring in debug mode:
(java:4037): Gdk-WARNING **: 10:08:34.009: XSetErrorHandler() called with a GDK error trap pushed. Don't do that.

During run time, the same code line will crash the program with the following error:

Runtime error::
cipimageadjustment._canvas5_mousereleased (java line: 295)
java.lang.NoClassDefFoundError: javafx/embed/swing/SwingFXUtils
    at anywheresoftware.b4a.objects.B4XViewWrapper$B4XBitmapWrapper.Crop(B4XViewWrapper.java:867)
    at b4j.serialtest.cipimageadjustment._canvas5_mousereleased(cipimageadjustment.java:295)
 

rspitzer

Active Member
The actual program ,is running in Linux, both in Bridge mode(Debug) and release mode. I will see what I can do to produce a code snippet.
 
Upvote 0

rspitzer

Active Member
Sorry for the delay in getting back, was doing a lot of testing.

1: No problems at all in windows.
2: The problem only occurs in Linux. (I have tested both JavaFX 11 and JavaFx 17 with the same results). This makes me thing its the distro I am using has some effect. Possibly a GTK issue that then effects JavaFx.

I think the problem is related from my testing, to the version of Javafx and the linux distro being used. I need to use the crop command in a machine vision application for one of my embedded controllers. What was interesting was that I did a search on the forum for Crop and found another library from Jmagicimage that seemed to work. The reason I say seemed is that I downloaded the test example and ran it on my embedded platform. Some of the examples in the test program had the exact same GDK failures and some did not. The crop command worked like a charm, I am not sure why, but this is an example program that can be used to test for the error which does crop up in (bad pun) other places.

My belief that why this has not been reported by another user is that (1) linux may not be as widely used, (2) The distro I am using is a fork for Ubuntu. Its rather stripped for speed and has a very small memory foot print ideal for the embedded boards I use Advantech, Odroid, Avalue and raspberry pi . If I have time I will need to go back and test an Ubuntu (non forked) release, and of course a raspberry pi original OS.

I would be interested to know if other forum members are using forked Linux releases, what they are and which version javafx they are using.
 
Upvote 0

Bernard Berger

Member
Licensed User
Same error:
java:2284): Gdk-WARNING **: 17:42:10.209: XSetErrorHandler() called with a GDK error trap pushed. Don't do that.

No crash though

Linux Mint 21.1
5.15.0-58-generic
jdk-11.0.1 from B4X

No problem under Windows.
 
Upvote 0

walt61

Active Member
Licensed User
Longtime User
Upvote 0
Top