Alert pop up with LWUIT

2019-07-18 04:19发布

How to create the pop up window using LWUIT? I want to show an alert and that alert automatically dispose after 5 to 10 sec's. How to do this with LWUIT?

1条回答
放我归山
2楼-- · 2019-07-18 04:24

Use this code and show the alert some periodic time.

        Dialog validDialog = new Dialog("Alert");
        validDialog.setScrollable(false);
        validDialog.setIsScrollVisible(false);
        validDialog.setTimeout(5000); // set timeout milliseconds
        TextArea textArea = new TextArea("...."); //pass the alert text here
        textArea.setFocusable(false);
        textArea.setIsScrollVisible(false);
        validDialog.addComponent(textArea);
        validDialog.show(0, 100, 10, 10, true);
查看更多
登录 后发表回答