使用LWUIT弹出警报 [英] Alert pop up with LWUIT

查看:79
本文介绍了使用LWUIT弹出警报的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用LWUIT创建弹出窗口?我想显示一个警报,并且该警报会在5到10秒后自动消失.如何使用LWUIT做到这一点?

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?

推荐答案

使用此代码并定期显示警报.

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

这篇关于使用LWUIT弹出警报的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆