is it possible to use run a java class in command line to run a certain class or function in a running swing?
such as , when java Test asd
will setText a running swing Jlabel to 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
). 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.
It's built into java from the beginning, reasonably simple and lightweight.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.