问题
The goal is to have the user select a java program, then my program opens up a JInternalFrame
with a JEditorPane
inside it as the console and places said JInternalFrame
in a JDeskopPane
. Is it possible to change all the Window
s the user's program may open into JInternalFrame
s and place them in said JDesktopPane
, as well?
(individual question from IDE-Style program running)
回答1:
I'm quite sure that this would not be possible to do without tampering with the binaries of the program that you're launching. If the target program performs something like new Window().show()
, you'll have little possibilities to "hook into" the system, and tell it to swap it for a JInternalFrame
.
What I'm saying is that if the program is written and compiled to show a top-level window, there is little you could do to change that. There is no "hook" into the system, with which you can say "put all future Window
s into this JInternalFrame
.
来源:https://stackoverflow.com/questions/4055467/is-it-possible-make-all-jframes-the-internal-program-uses-into-jinternalframes-a