Other B4J Colorpicker control

Discussion in 'Android Questions' started by touchsquid, Feb 28, 2015.

Similar threads

B4J Library [B4X] [class] UndoManager
B4A Code Snippet Color Picker
B4A Code Snippet Theme Colors
B4J Tutorial [B4X] FontAwesome & Material Icons fonts
B4A Tutorial CharSequence / CSBuilder Tutorial
  1. touchsquid

    touchsquid Active Member Licensed User

    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!
     
  2. touchsquid

    touchsquid Active Member Licensed User

    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
     
  3. Erel

    Erel Administrator Staff Member Licensed User

Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice