externalFrame.setSize(200, 200);
}
Graphics g = externalFrame.getGraphics();
g.clearRect(0, 0, 200, 200);
externalFrame.paint(g);
g.translate(externalFrame.getInsets().left, externalFrame.getInsets().top);
((Graphics2D)g).setTransform(((Graphics2D)originalGraphics).getTransform());
g.setColor(originalGraphics.getColor());