Season greeting to everyone,
I have a spinner control that I like to customize in code. In a simple example:
When running the code it bombs out and the following error message is received:
The same error code is received when using numeric (see code above).
Apparently there is something that I miss...
TIA,
Dennis
I have a spinner control that I like to customize in code. In a simple example:
B4X:
Sub Process_Globals
Private fx As JFX
Private MainForm As Form
Private Spinner1 As Spinner
End Sub
Sub AppStart (Form1 As Form, Args() As String)
MainForm = Form1
MainForm.RootPane.LoadLayout("Spinner") 'Load the layout file.
Config_Spinner
MainForm.Show
End Sub
Sub Config_Spinner()
Dim dbMin As Double = 1
Dim dbMax As Double =500
Dim dbSteps As Double = 1
Dim dbInitial As Double = 1
Spinner1.SetNumericItems(dbMin,dbMax,dbSteps,dbInitial)
'Spinner1.SetNumericItems(1,500,1,1)
End Sub
B4X:
Waiting for debugger to connect...
Program started.
Error occurred on line: 25 (Main)
java.lang.NullPointerException
at com.sun.javafx.binding.ExpressionHelper.removeListener(ExpressionHelper.java:74)
at javafx.beans.property.ObjectPropertyBase.removeListener(ObjectPropertyBase.java:92)
at anywheresoftware.b4j.objects.SpinnerWrapper.removeListener(SpinnerWrapper.java:77)
at anywheresoftware.b4j.objects.SpinnerWrapper.SetNumericItems(SpinnerWrapper.java:91)
at b4j.example.main._config_spinner(main.java:107)
at b4j.example.main._appstart(main.java:75)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:612)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:229)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:159)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:93)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:90)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:84)
at b4j.example.main.start(main.java:38)
at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$162(LauncherImpl.java:863)
at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$175(PlatformImpl.java:326)
at com.sun.javafx.application.PlatformImpl.lambda$null$173(PlatformImpl.java:295)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.application.PlatformImpl.lambda$runLater$174(PlatformImpl.java:294)
at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at com.sun.glass.ui.win.WinApplication.lambda$null$148(WinApplication.java:191)
at java.lang.Thread.run(Thread.java:745)
The same error code is received when using numeric (see code above).
Apparently there is something that I miss...
TIA,
Dennis