import java.awt.*;
import javax.swing.*;
import java.awt.geom.*;
public class FillArc extends JPanel {
public void paintComponent(Graphics g) {
Graphics2D g2 = (Graphics2D) g;
// fill Arc2D
g2.setPaint(Color.red);
g2.fill(new Arc2D.Double(20, 20, 200, 100, 90, 180, Arc2D.OPEN));
}
public static void main(String[] args) {
JFrame.setDefaultLookAndFeelDecorated(true);
JFrame frame = new JFrame("Fill Arc Example ");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setBackground(Color.white);
frame.setSize(300, 200);
FillArc panel = new FillArc();
frame.add(panel);
frame.setVisible(true);
}
}
Comentarios sobre la versión: 1 (0)
No hay comentarios