Fill Arc : Arc « 2D Graphics « Java Tutorial






Fill Arc
import java.awt.Color;
import java.awt.Graphics;

import javax.swing.JComponent;
import javax.swing.JFrame;

class MyCanvas extends JComponent {

  public void paint(Graphics g) {
    g.setColor(Color.RED);
    g.fillArc(20, 20, 200, 200,200,200);
  }
}

public class FillArc {
  public static void main(String[] a) {
    JFrame window = new JFrame();
    window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    window.setBounds(30, 30, 300, 300);
    window.getContentPane().add(new MyCanvas());
    window.setVisible(true);
  }
}








16.9.Arc
16.9.1.Draw ArcDraw Arc
16.9.2.Fill ArcFill Arc
16.9.3.Arc2D PIEArc2D PIE
16.9.4.Arc2D OPENArc2D OPEN
16.9.5.Arc2D ChordArc2D Chord
16.9.6.Drawing a Pie Chart
16.9.7.Compares two arcs and returns true if they are equal or both null.