Dear community,
i have to work with a swing JFrame (because an old ext.Lib. needs one...).
Please see the example, frameevent is working,
frameevent2 not.
No firering.
Any ideas?
thnks a lot
patent
i have to work with a swing JFrame (because an old ext.Lib. needs one...).
Please see the example, frameevent is working,
frameevent2 not.
No firering.
Any ideas?
thnks a lot
patent
B4X:
Sub Process_Globals
Private fx As JFX
Private MainForm As Form
Dim joJFrame As JavaObject
End Sub
Sub AppStart (Form1 As Form, Args() As String)
MainForm = Form1
MainForm.Show
joJFrame.Initializenewinstance("javax.swing.JFrame",Null)
joJFrame.RunMethod("setTitle",Array("JFrame"))
joJFrame.RunMethod("setSize",Array(300,300))
Dim frame As JavaObject=joJFrame
Dim listener As JavaObject=joJframe.CreateEvent("java.awt.event.WindowListener","frameevent",False)
frame.RunMethod("addWindowListener",Array As Object(listener))
Dim listener2 As JavaObject=frame.CreateEvent("java.awt.event.MouseListener","frameevent2",False)
frame.RunMethod("addMouseListener",Array As Object(listener2))
joJFrame.RunMethod("addNotify",Null)
joJFrame.RunMethod("setVisible",Array(True))
End Sub
Sub frameevent_Event (MethName As String,Args() As Object) As Object
Log(MethName)
End Sub
Sub frameevent2_MousePressed (e As MouseEvent)
Log(e)
End Sub