Java attach JFrame to a running application window?

风格不统一 提交于 2019-12-10 11:24:47

问题


How can I attach a JFrame in the top right to another applications open window and stay with it while resizing? Is it possible?

Here is a diagram of what i would like to accomplish:

Thanks for the help! If this is not possible, are there alternatives?

Ways to get window size/location and set my own jframe accordingly?


回答1:


You are asking Java to modify an already running non-Java program, and for these types of problems, Java is not the best tool. Please understand that one of Java's main strengths is its ability to run compiled code unchanged on multiple platforms. With this strength comes a weakness: of necessity, Java must be as OS agnostic as possible, and because of this, it is not a good tool when code needs to get cozy with the OS.

Alternatives: just about any other language that can allow easy OS calls.

Don't get me wrong, you can do some similar stuff with Java, but it requires that you jump through hoops that just aren't needed when using other tools.



来源:https://stackoverflow.com/questions/24482099/java-attach-jframe-to-a-running-application-window

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!