3 import java.awt.event.*;
6 public class AngCanvas extends Canvas implements Observer
10 public AngCanvas (Angulo g) {
11 radianes = g.getGrados ();
14 public void paint(Graphics g) {
15 g.setColor(Color.BLACK);
16 g.fillRect(0, 0, 400, 400);
17 g.setColor( Color.RED );
18 g.fillArc(100, 100, 200 , 200, 0, radianes);
19 System.out.println (radianes);
22 public Dimension getPreferredSize(){
23 return new Dimension (400, 400);
26 public void update(Observable obs, Object obj)
28 if (obs instanceof Angulo) {
29 radianes = ((Angulo)obs).getGrados ();