public static void paintWithAlpha(Graphics g, float alpha, @NotNull Runnable paint) {
    Graphics2D g2 = (Graphics2D)g;
    Composite oldComposite = g2.getComposite();
    g2.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, alpha));
    paint.run();
    g2.setComposite(oldComposite);
  }
public static void paintWithAlpha(Graphics g, float alpha, @NotNull Runnable paint)