Fix bug in luajava.createProxy() and demonstrate its use.

This commit is contained in:
Ian Farmer
2008-11-27 08:32:33 +00:00
parent 1901448172
commit 41b3997166
5 changed files with 30 additions and 10 deletions

View File

@@ -18,3 +18,12 @@ jframe = luajava.bindClass( "javax.swing.JFrame" )
frame:setDefaultCloseOperation(jframe.EXIT_ON_CLOSE)
frame:pack()
frame:setVisible(true)
local listener = luajava.createProxy("java.awt.event.MouseListener",
{
mouseClicked = function(me)
print("clicked!", me)
end
})
frame:addMouseListener(listener)