如何将外部文字处理应用程序与 Java Swing 应用程序集成?
我需要一些关于这方面的天才建议。
我有一个 Java Swing 应用程序,需要启动文字处理器,以便用户完成一些工作,然后检索该工作的输出并稍后对其进行评估。
在我的脑海中,我认为我的应用程序可以在正常位置查找 Open Office 或 Word 可执行文件,以查看是否安装了其中一个程序,然后创建一个进程并阻止 Swing 窗口,直到该进程返回。这真的是最好的方法吗?另外,如何来回传递数据?
我已经研究过 Open Office java bean,但可惜我不认为有 Mac/Linux 支持。
所以,总结一下我的问题:
- 为文字处理器创建一个进程是做到这一点的最佳方法吗?
- 我如何在我的应用程序和文字处理器之间传递信息(更具体地说,当他们完成创建文档时,Swing 应用程序如何获取它)
谢谢,
Ben
I need some genius advice on this one.
I have a Java Swing application that needs to launch a word processor in order to allow the user to complete some work, and then retrieve the output of that work and evaluate it later.
In my head I am thinking my application can look in the normal places for Open Office or Word executables to see if one of those programs is installed, and then create a process and block the Swing window until that process returns. Is this really the best way to go? Also, how can I pass data back and forth?
I looked into the Open office java bean already, but alas I do not think there is Mac/Linux support.
So, to sum up my question:
- is creating a process for the word processor the best way to do this?
- how can I pass info between my app and the word processor (more specifically, when they have finished creating their document, how can the Swing app get it)
Thanks,
Ben
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
使用适用于 Linux 的 open office sdk。您可能想在服务器模式下使用开放办公室。
Use the open office sdk, which is available for Linux. You might want to use open office in server mode.
您可以将 docx4all(基于 Swing 的 docx 文字处理器)集成到您的应用程序中。
You could integrate docx4all (Swing based docx word processor) into your app.