[英]java inter-process communication
is it possible to use run a java class in command line to run a certain class or function in a running swing? 是否可以在命令行中运行java类来在正在运行的swing中运行某个类或函数?
such as , when java Test asd
will setText a running swing Jlabel to asd 例如,当
java Test asd
将setText运行一个Jlabel运行到asd时
The two programs run in separate processes. 这两个程序在不同的进程中运行。 You will need to create an interface between the processes (or as Matthew put it: implement
inter-process communication
). 您需要在进程之间创建一个接口(或者像Matthew所说的那样:实现
inter-process communication
)。 There are millions of ways to achieve this, just to name a few: 有数百种方法可以实现这一点,仅举几例:
The most straight forward way is to create an RMI method call. 最直接的方法是创建一个RMI方法调用。
It's built into java from the beginning, reasonably simple and lightweight. 它从一开始就内置于java中,相当简单轻巧。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.