如何将外部文字处理应用程序与 Java Swing 应用程序集成?

发布于 2024-09-06 07:04:18 字数 440 浏览 1 评论 0原文

我需要一些关于这方面的天才建议。

我有一个 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

梦里人 2024-09-13 07:04:18

使用适用于 Linux 的 open office sdk。您可能想在服务器模式下使用开放办公室。

Use the open office sdk, which is available for Linux. You might want to use open office in server mode.

好听的两个字的网名 2024-09-13 07:04:18

您可以将 docx4all(基于 Swing 的 docx 文字处理器)集成到您的应用程序中。

You could integrate docx4all (Swing based docx word processor) into your app.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文