import java.awt.*; import java.awt.geom.*; import java.awt.image.*; import java.applet.*; public class Labipaistmine extends Applet{ public void paint(Graphics g){ Graphics2D g2=(Graphics2D)g; g2.setColor(Color.red); g2.fillRect(20, 50, 100, 100); g2.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.7f)); g2.setColor(Color.blue); //70% joonistab, 30% paistab alt läbi g2.fillRect(60, 60, 100, 70); } public static void main(String argumendid[]){ Frame f=new Frame("Muster taustaks"); f.add(new Labipaistmine()); f.setSize(250, 250); f.setVisible(true); } }