我创建了一个 JFrame,它为这样的游戏加载外部小程序:
//Setup everything for the Stub.. Below adds the stub to the applet and creates it.
DownloadFile(new URL(World + "/" + Archive), "./gamepack.jar");
CAppletStub Stub = new CAppletStub(new URL(World), new URL(World), this.Parameters);
applet = (Applet) new URLClassLoader(new URL[] {new URL(World.toString() + "/" + Archive)}).loadClass("Rs2Applet").newInstance();
applet.setStub(Stub);
applet.init();
applet.start();
applet.setPreferredSize(new Dimension(Width, Height));
Frame.getContentPane().add(applet);
我正在尝试截取这个小程序或让它在 BufferedImage 中绘制它的表面。我尝试将“Applet”子类化并将我的 URLClassLoader 转换为该类,但它无法转换,这是有道理的。
如何捕获小程序渲染成图像的所有内容?