Can't copy to a clipboard from a background java application on MAC OSX

后端 未结 1 1804
攒了一身酷
攒了一身酷 2021-01-22 19:29

We have 2 java applications running on MAC. One background application sends either a text or image to a clipboard, then the other application grabs that data and paste it in it

1条回答
  •  野的像风
    2021-01-22 19:56

    Don't.

    What you are doing is generally referred to as "interprocess communication". There are various strategies to accomplish this. One of the more 'correct' approaches, in your cotext of two Java applications, would be to use Java RMI.

    Doing it in a non-standard, "hackish" manner like you are with the clipboard is more problematic...as you have discovered the hard way.

    Even if you did manage to get it running, the possibilities of problems in the future are high. E.g.: Imagine a Windows update changing the behavior of the clipboard--it would break your app on Windows.

    0 讨论(0)
提交回复
热议问题