I have an application that provides a JFrame. User's can import graphics and type text. Then the contents of the JFrame can be exported. It is like a screen shot, but other windows don't obscure the exported image.
Thanks to other Forum participants who helped me understand these techniques.
System.out.println("Export page..");
Container cp = getContentPane();
BufferedImage buf = new BufferedImage(cp.getWidth(),cp.getHeight(), BufferedImage.TYPE_INT_RGB);
Graphics2D bufg = (Graphics2D) buf.getGraphics();
cp.paintAll(bufg);
try {
ImageIO.write(buf, "png", new File("frame_export.png")); }
catch(Throwable t) { t.printStackTrace(); }
System.out.println("Export Done");