title: Java Swing - Translucent Components
body: <p>I recently asked a question about translucent components causing odd artifacts from seemingly not updating properly. The answer I received caused the artifacts to go away, but at the cost of translucency.</p>
  
  <p>The solution was to- for every translucent component- also call the setOpaque(false) function. This way, Swing knew that it needed to redraw the background behind those components.</p>
  
  <p>However, this came at the cost of the translucency that I was trying to achieve. It caused the components to become transparent instead.</p>
  
  <p>The premise is this: I am designing the GUI for a chat client, and a feature request was to have a background. I successfully got the background working by following a code snippet for extending the JPanel class, but then I wanted the components to allow the background to show. After setting their translucency, remnants of updated components were being displayed where they shouldn't have been. I came here and got my problem solved, but now I've got a new problem. So here we are.</p>
  
  <p>So, here is what I've surmised:</p>
  
  <p>-Calling the setOpaque(false) function for each desired component and NOT setting a translucent color does not achieve what I want.</p>
  
  <p>-Setting a translucent color and NOT calling setOpaque(false) allows the translucent background to show, but causes artifacts, putting me back at square one.</p>
  
  <p>So I need some middle ground between transparent with no artifacts, and translucent with artifacts. Namely, I want a translucent background (not completely transparent) that has no artifacts.</p>
  
  <p>It seems like I'm going to need to override the JFrame to cause it to repaint all its components, regardless of the opacity. Unless there's something I'm missing.. which is why I'm here!</p>
  
  <p>Thanks!</p>
  
  <p>(Here's a link to the original question, with a picture for reference: <a href="https://stackoverflow.com/questions/4980246/java-swing-translucent-components-causing-artifacts">Java Swing - Translucent Components causing Artifacts</a>)</p>