Ok, I think I figured it out....at least a solution that works for me and is described above and here is some example code:
[code] // Original rounded rectangle RoundRectangle2D roundedRectangle = new RoundRectangle2D.Double(x, y, width, height, arc, arc); // Fill original rectangle first in orange g2.setColor(Color.orange); g2.fill(rect); // Create a mask of the desired width that will be used to get the cut out of the shape // I want to make gray ... in this case, I chose width/4 (or 25%) of the width to use // as the mask Rectangle2D mask = new Rectangle2D.Double(x, y, width/4.0, height); // Create an area of the original rounded rectangle Area area1 = new Area(roundedRectangle); // Create an area for the mask Area area2 = new Area(mask); // Get the intersection of the two Area objects and then draw it...this returns the first // 25% of the rounded rectangle, since both the mask and the rectangle were given // the same initial coordinates, but the mask was only drawn over 25% of the width // of the original rounded rectangle area1.intersect(area2); // Fill the resulting area with a gray color and since it is drawn last it will // be drawn on top of the image g2.setColor(Color.gray); g2.fill(area1); [/code] [Message sent by forum member 'zaczek' (zaczek)] http://forums.java.net/jive/thread.jspa?messageID=331841 =========================================================================== To unsubscribe, send email to lists...@java.sun.com and include in the body of the message "signoff JAVA2D-INTEREST". For general help, send email to lists...@java.sun.com and include in the body of the message "help".