简体   繁体   English

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

[英]How can I integrate an external word processing application with a Java Swing app?

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. 我有一个Java Swing应用程序需要启动一个文字处理器,以便允许用户完成一些工作,然后检索该工作的输出并在以后进行评估。

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. 在我看来,我认为我的应用程序可以在Open Office或Word可执行文件的正常位置查看是否安装了其中一个程序,然后创建一个进程并阻止Swing窗口,直到该进程返回。 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. 我已经查看了Open office java bean,但是我不认为有Mac / Linux支持。

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) 如何在我的应用程序和文字处理器之间传递信息(更具体地说,当他们完成创建文档时,Swing应用程序如何获取它)

Thanks, 谢谢,

Ben

Use the open office sdk, which is available for Linux. 使用可用于Linux的开放式办公室sdk。 You might want to use open office in server mode. 您可能希望在服务器模式下使用开放式办公室。

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM