Sun Java Solaris Communities My SDN Account Join SDN
 
Code sample

Code Samples from the Java Developers Almanac 2000

 


Code Samples Index

These code examples and other materials are subject to Sun Microsystems, Inc. Legal Terms

Drawing with Alpha

 drawGraphic1(g2d);
     
 // Set alpha.  0.0f is 100% transparent and 1.0f is 
 // 100% opaque.
 float alpha = .7f;
 g2d.setComposite(
   AlphaComposite.getInstance(
     AlphaComposite.SRC_OVER, alpha));
    
 drawGraphic2(g2d);
 

Examplets provided by permission of the publisher, Addision-Wesley, and Author Patrick Chan.

Order this book from Amazon