开发者

jnlp unaivalable service exception

I am tryin开发者_如何转开发g to use the FileOpenSerivce, but I always get an UnaivableServiceException regardless of whether I run it from Eclipse, or from my local webserver using the jnlp file.

I am using an unsigned jar, which from what I understand is ok.

I got a debugger connected, and when running under Webstart, everything seems to succeed just fine. I am attempting to get FileContents like so:

FileContents fileContents = fileOpenService.openFileDialog(null, null);

I never see a dialog, and fileContents is always null.

Thanks!


So this whole thing was a threading problem. In my main class, MainFrame, my main method was

public static void main (String[] args) {
    new MainFrame ();
}

I replaced it with this:

javax.swing.SwingUtilities.invokeLater(new Runnable() {
        public void run() {
            new MainFrame();
        }
    });

And it all works fine now.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜