/*
 * $Id$
 *
 * Copyright 2004 Sun Microsystems, Inc., 4150 Network Circle,
 * Santa Clara, California 95054, U.S.A. All rights reserved.
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 */
package org.jdesktop.swingx.painter;

import org.jdesktop.swingx.JXPanel;

import javax.swing.*;
import java.awt.*;

/**
 * Demo of the AlphaPainter.
 */
public class AlphaPainterDemo {
    private AlphaPainterDemo() {}

    public static void main(String ... args) {
        JXPanel panel = new JXPanel();
        AlphaPainter alpha = new AlphaPainter();
        alpha.setAlpha(1f);
        alpha.setPainters(new PinstripePainter(new Color(255,255,255,125),45,20,20));
        panel.setBackgroundPainter(new CompoundPainter(
                new MattePainter(Color.RED),
                alpha
                ));

        JFrame frame = new JFrame();
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.add(panel);
        frame.pack();
        frame.setSize(200,200);
        frame.setVisible(true);
    }
}

@@ -1144,16 +1144,108 @@
 args) %7B%0A
+        SwingUtilities.invokeLater(new Runnable() %7B%0A            public void run() %7B%0A        
         
@@ -1283,16 +1283,24 @@
         
+      
+  
 AlphaPai
@@ -1328,24 +1328,32 @@
 aPainter();%0A
+        
         alph
@@ -1368,32 +1368,40 @@
 ha(1f);%0A        
+   
+     
 alpha.setPainter
@@ -1462,16 +1462,24 @@
 0,20));%0A
+        
         
@@ -1542,16 +1542,24 @@
         
+ 
+       
 new Matt
@@ -1591,24 +1591,32 @@
             
+       
+ 
 alpha%0A      
@@ -1629,21 +1629,34 @@
     
-));%0A%0A
+        ));%0A%0A     
         
 JFra
@@ -1651,16 +1651,19 @@
         
+   
 JFrame f
@@ -1679,24 +1679,32 @@
 w JFrame();%0A
+        
         fram
@@ -1757,24 +1757,32 @@
 E);%0A        
+   
+     
 frame.add(pa
@@ -1791,24 +1791,32 @@
 l);%0A        
+  
+      
 frame.pack()
@@ -1817,32 +1817,40 @@
 pack();%0A        
+ 
+       
 frame.setSize(20
@@ -1857,32 +1857,40 @@
 0,200);%0A        
+       
+ 
 frame.setVisible
@@ -1897,16 +1897,42 @@
 (true);%0A
+            %7D%0A        %7D);%0A
     %7D%0A%7D%0A

Put everything on the EDT