java中使用网页转图片紧急求助

使用该帖子中方法链接
将html转图片时, 调用第二次的时候会报java.lang.IllegalStateException: runEventPump was already called and can only be called once (the first call should be at the end of the main method)!错误,请问你遇到这个情况了吗?这个可以解决吗?

runEventPump was already called and can only be called once
只能调用1次,因为它需要UI线程,所以你应该把它做成单例对象,而不是用一次创建一次。

@caozhy 是指的NativeInterface对象,还是JWebBrowser对象?