view src/luan/modules/swing/Label.luan @ 1735:4b56eff90040 default tip

add hosting.html
author Franklin Schmidt <fschmidt@gmail.com>
date Sun, 02 Oct 2022 17:32:00 -0600
parents 915cb538e2a3
children
line wrap: on
line source

local Luan = require "luan:Luan.luan"
local error = Luan.error
local set_metatable = Luan.set_metatable or error()
require "java"
local JLabel = require "java:javax.swing.JLabel"


local Label = {}

local mt = {}

function mt.__index(label,key)
	error("'"..key.."' not defined")
end

function mt.__new_index(label,key,value)
	error("'"..key.."' not defined")
end

function Label.new(text)
	local jlabel = JLabel.new(text)
	local label = { java = jlabel }
	set_metatable(label,mt)
	return label
end

return Label