by Dinesh Thakur Category: Java 2D Example

In this example we show how the Set operations going to make a Intersection of 2 circles . Intersection examples how the code as follows:

import java.applet.Applet;

import java.awt.*;
import java.awt.event.*;
import java.awt.Color;
import java.awt.Graphics;
import javax.swing.*;
import java.awt.geom.*;
import java.awt.image.*;
public class DrawintersectExample extends Applet {
public static void main(String[] args) {
Frame Drawintersect = new Frame("Draw intersect Example");
Drawintersect.setSize(350, 250);
Applet DrawintersectExample = new DrawintersectExample();
Drawintersect.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
  public void paint(Graphics g) {
    g.setFont(new Font("Arial",Font.BOLD,14));
    g.drawString("Draw intersect Example", 50, 40);
    g.setFont(new Font("Arial",Font.BOLD,10));
    g.drawString("", 200, 205);
                Graphics2D G2D = (Graphics2D)g;
                GradientPaint GPaint = new GradientPaint(50.0f, 50.0f,,200.0f, 50.0f,;
                Ellipse2D E2D = new Ellipse2D.Double(50.0, 50.0, 80.0, 80.0);
                Ellipse2D E2D2 = new Ellipse2D.Double(100.0, 50.0, 80.0, 80.0);
                Area area1 = new Area(E2D);
                Area area2 = new Area(E2D2);

Set operations  Intersection Java Example

About Dinesh Thakur

Dinesh ThakurDinesh Thakur holds an B.SC (Computer Science), MCSE, MCDBA, CCNA, CCNP, A+, SCJP certifications. Dinesh authors the hugely popular blog. Where he writes how-to guides around Computer fundamental , computer software, Computer programming, and web apps. For any type of query or something that you think is missing, please feel free to Contact us.

Search Content