static BufferedImage renderComponentToImage(final Component c) { if (c == null) null; ret swing(func -> BufferedImage { int w = getWidth(c), h = getHeight(c); BufferedImage img = newBufferedImage(w, h); c.paint(createGraphics(img)); ret img; }); }