Friday, 14 December 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

php - file_get_contents shows unexpected output while reading a file

I want to output an inline jpg image as a base64 encoded string, however when I do this : $contents = file_get_contents($filename); print &q...