Friday, December 14, 2018

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

plot explanation - Why did Peaches' mom hang on the tree? - Movies & TV

In the middle of the movie Ice Age: Continental Drift Peaches' mom asked Peaches to go to sleep. Then, she hung on the tree. This parti...