Alert pop up with LWUIT

六月ゝ 毕业季﹏ 提交于 2019-12-11 03:46:29

问题


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:


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);


来源:https://stackoverflow.com/questions/6773719/alert-pop-up-with-lwuit

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!