touchsquid Active Member Licensed User Longtime User Feb 28, 2015 #1 In the Java layout designer there is a colorpicker control. When I use it in a layout it works, but the "generate members" dialog does not show any event for color changed. I tried MouseClicked but that happens BEFORE the color change. I am able to use the FocusChanged event to get the color value(using JavaObject) but that only happens if the user clicks another button. Any idea how to get the color change event? Thanks!
In the Java layout designer there is a colorpicker control. When I use it in a layout it works, but the "generate members" dialog does not show any event for color changed. I tried MouseClicked but that happens BEFORE the color change. I am able to use the FocusChanged event to get the color value(using JavaObject) but that only happens if the user clicks another button. Any idea how to get the color change event? Thanks!
touchsquid Active Member Licensed User Longtime User Feb 28, 2015 #2 Got it working: Code: Dim CP As JavaObject = FColorChoice 'the colorpicker control ID Dim E As Object = CP.CreateEventFromUI("javafx.event.EventHandler","FColorChoice",Null) CP.RunMethod("setOnAction",Array(E)) Event: Code: Sub FcolorChoice_Event(MethodName As String,Args() As Object) Dim JO As JavaObject = FColorChoice Dim colorvalue As String = JO.RunMethod("getValue", Null) Log(colorvalue) End Sub Upvote 0
Got it working: Code: Dim CP As JavaObject = FColorChoice 'the colorpicker control ID Dim E As Object = CP.CreateEventFromUI("javafx.event.EventHandler","FColorChoice",Null) CP.RunMethod("setOnAction",Array(E)) Event: Code: Sub FcolorChoice_Event(MethodName As String,Args() As Object) Dim JO As JavaObject = FColorChoice Dim colorvalue As String = JO.RunMethod("getValue", Null) Log(colorvalue) End Sub
Erel B4X founder Staff member Licensed User Longtime User Mar 1, 2015 #3 ColorPicker is also available in jControlsFX library: https://www.b4x.com/android/forum/threads/controlsfx-library.50700/#content Upvote 0
ColorPicker is also available in jControlsFX library: https://www.b4x.com/android/forum/threads/controlsfx-library.50700/#content