import java.awt.*;
import java.awt.geom.*;
import java.awt.image.*;
import java.net.URL;

public class textureElipsSWF_2000 extends JFrame {

  TexturePaint tp = getImageTexture ("sybex.gif");

  public TexturePaint getImageTexture(String imageFile) {
    URL url = getClass().getResource("sybex.gif");
    Image img = getToolkit().getImage(url);
    try {
      MediaTracker tracker = new MediaTracker(this);
      tracker.addImage(img, 0);
      tracker.waitForID(0);
    } catch (Exception e) {
    }
    int width = img.getWidth(this);
    int height = img.getHeight(this);
    BufferedImage buffImg = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB);
    Graphics g = buffImg.getGraphics();
    g.drawImage(img, 0, 0, this);
    Rectangle2D rect = new Rectangle(0, 0, width, height);
    return new TexturePaint(buffImg, rect);
  }

  public void paint (Graphics g) {
    Graphics2D g2d = (Graphics2D)g;

    g2d.setPaint (tp);
    Rectangle2D rectangle = new Rectangle2D.Double (0, 0, 200, 100);
    g2d.fill (rectangle);

    Arc2D arc = new Arc2D.Double (0, 125, 200, 100, 45, 300, Arc2D.PIE);
    g2d.fill (arc);
  }
}