def __init__(self):
        super(JSApiExample, self).__init__()

        self._toBeUpdatedFromThread = None
        self._startThread = None
        self._running = Label('')

        self.setSpacing(True)

        javascript = Label("<h3>Run Native JavaScript</h3>",
                Label.CONTENT_XHTML)
        self.addComponent(javascript)

        script = TextArea()
        script.setWidth('100%')
        script.setRows(3)
        script.setValue('alert(\"Hello Muntjac\");')
        self.addComponent(script)

        self.addComponent(Button('Run script', RunListener(self, script)))