0

对不起,我的英语不好。

我从网络下载了一张图片,我设置了超时 2000 毫秒,但超时不起作用。这是我的代码

    public void actionPerformed(ActionEvent evt) {
    if (evt.getSource() == okCommand) {
        final Form resultForm = new Form("Result");
        resultForm.setLayout(new BoxLayout(BoxLayout.Y_AXIS));
        resultForm.show();
        Label mLabel = new Label();
        ImageDownloadService img = new ImageDownloadService("http://datastore04.rediff.com/h1500-w1500/thumb/69586A645B6D2A2E3131/s47kscdm7r4pjx05.D.0.Happy-Valentines-Day-Wallpaper-Image.jpg", mLabel);
        img.setTimeout(2000);
        NetworkManager.getInstance().addToQueue(img);
        resultForm.addComponent(mLabel);
        Progress progress = new Progress("Loading", img);
        progress.setDisposeOnCompletion(true);
        progress.show();
    }
4

1 回答 1

0

我们在处理 LWUIT 时遇到了一些问题。它应该与Codename One一起工作,尽管在 J2ME 上它会被“伪造”,因为 J2ME 不允许超时,所以我们基本上杀死了整个线程。

于 2013-07-03T17:49:42.323 回答