Tuesday, 19 July 2016

java - Launching a JFrame into another JFrame

Is it possible for someone to launch a JFrame from a java program, but instead of the JFrame creating its own window, the java program launches it into an existing window? I thought of trying a classloader, something like this:



    Class framed = WhateverClassThisIs.class.getClassLoader().loadClass("foo.class");
JFrame launch = (JFrame) framed.newInstance();
WhatEverJFrameBeingUsed.add(launch);


and then just simply add it to the container i'm using currently. But what if the class references another JFrame, like a main class, how do i get that JFrame and contain it in the same existing JFrame? Is it possible to get a Graphics object from a PID, or some other reference to the program?




EDIT: I'm doing this in Linux, on XOrg, preferably on Debian Squeeze

No comments:

Post a Comment

c++ - Does curly brackets matter for empty constructor?

Those brackets declare an empty, inline constructor. In that case, with them, the constructor does exist, it merely does nothing more than t...