title: Java Graphics2D transparent background
body: <p>I have a <code>Graphics2D</code> object and I want to set up the background of the object. It has a <code>setBackground</code> method, which has a Color parameter. This way I can set the color of the background.</p>
  
  <p>My question is: how can I set the transparency of the background of the object? Can I somehow tell it to be completely transparent? Can I somehow tell it to be completely opaque? Can I somehow tell it to have 0.8 transparency/opacity? How can I set these values?</p>
  
  <p>I have seen that there are int predefined values called <code>TRANSLUCENT</code> and <code>OPAQUE</code>, but I am not sure how can I use them.</p>
  
  <p>Maybe the correct usage is to call the constructor of Color with an int parameter?</p>