title: How to create partly transparent JButton on fully transparent JFrame?
body: <p>I am able to make JFrame totally transparent and the JButton is partly transparent just fine until I move my mouse on the button ( do not click ) and move the mouse off from the button ( MouseExited called via MouseListener ). What happens is that the background of the JButton is drawn again, so after couple of mouse movements on and off the button the button is totally opaque.</p>
  
  <pre><code>public class ButtonExample extends JWindow
  {
     public ButtonExample( )
     {
          JButton But = new JButton( "Testing" );
          But.setBackground( new Color( 0, 0, 0, 200 ) );
          But.setForeground( new Color( 70, 155, 255 ) );
          this.add( But );
          this.setBackground( new Color( 0, 0, 0, 0 ) );
          this.setMinimumSize( new Dimension( 200,100 ) );
          this.setVisible( true );
      }
  
      public static void main( String[ ] Args ) 
      {
          new ButtonExample( );
      }
  }
  </code></pre>