3 import java.awt.event.*;
6 public class FrGraf extends Frame implements Observer
11 public FrGraf (Fraccion f)
14 label = new Label(f.toString (), Label.CENTER);
16 panel.setLayout (new BorderLayout ());
17 panel.add (label, BorderLayout.CENTER);
19 add (panel, BorderLayout.CENTER );
26 public void update(Observable obs, Object obj)
28 if (obj instanceof Fraccion) {
29 label.setText (obj.toString ());
35 static public void main (String[] args) {
36 Fraccion modelo = null;
38 modelo = new Fraccion (5, 4);
43 FrGraf vista = new FrGraf (modelo);