### Handle MouseClick Event

This example shows how to handle special MouseClick handler for a TextField.
Define the textfield
`Sub Process_Globals
...
Private tfEventTest As TextField
End Sub`
Create the MouseClick Event
`Sub AppStart (Form1 As Form, Args() As String)
...
Dim joTF As JavaObject = tfEventTest
Dim oTF As Object = joTF.CreateEvent("javafx.event.EventHandler","TextFieldMouseClicked",False)
joTF.RunMethod("setOnMouseClicked",Array(oTF))
End Sub`
' Handle mouseclicked event in a textfield.
' The mouse event API method getSource is used to get the textfield clicked. The event first argument is used for that.
`Private Sub TextFieldMouseClicked_Event(EventName As String,Args() As Object) As Object 'ignore
If Args.length > 0 Then
Dim KEventJO As JavaObject = Args(0)
Dim tf As TextField = KEventJO.RunMethod("getSource",Null)
' Do SOMETHING with the TextField
End If
Return False
End Sub`

Changed: , Category: TextField, File: T6C262M1940.htm, ID: 1940