fillArc() always draws an arc inside a circle or oval, which is, in turn, inside a square or rectangle. The bounding box (shown in black) and bounding oval (shown in red) are not displayed, but are used as guidelines for the arc.Fills a circular or elliptical arc covering the specified rectangle.
Syntax:fillArc(int x, int y, int width, int height, int startAngle, int arcAngle)
Example:import java.lang.*;
import java.util.*;
import java.util.List;
import java.io.*;
import java.awt.*;
import java.awt.event.*;
import java.awt.geom.*;
public class MyFillArc extends Frame {
public void paint(Graphics g) {
Graphics2D ga = (Graphics2D)g;
ga.setPaint(Color.red);
ga.fillArc(50,50,300,150, 0, 90);
ga.setPaint(Color.blue);
ga.fillArc(50,50,300,150, 90, 90);
ga.setPaint(Color.green);
ga.fillArc(50,50,300,150, 180, 90);
ga.setPaint(Color.black);
ga.fillArc(50,50,300,150, 270, 90);
}
public static void main(String args[])
{
MyFillArc frame = new MyFillArc();
frame.addWindowListener(
new WindowAdapter()
{
public void windowClosing(WindowEvent we)
{
System.exit(0);
}
}
);
frame.setSize(400, 400);
frame.setVisible(true);
}
}
License.
All information of this service is derived from the free sources and is provided solely in the form of quotations.
This service provides information and interfaces solely for the familiarization (not ownership) and under the "as is" condition.
Copyright 2016 © ELTASK.COM. All rights reserved.
Site is optimized for mobile devices.
Downloads: 565 / 159226512. Delta: 0.00154 с