//...
    //Red is not transparent
    g2.setComposite(
         AlphaComposite.getInstance(
             AlphaComposite.SRC_OVER,1.0f));
    //...
    //Green is 50 percent transparent
    g2.setComposite(
         AlphaComposite.getInstance(
             AlphaComposite.SRC_OVER,0.5f));
    //...
    //Blue is 90-percent transparent
    g2.setComposite(
         AlphaComposite.getInstance(
             AlphaComposite.SRC_OVER,0.1f));

Figure 12