import java.awt.*;
import javax.swing.*;
/**
* Need our own little class for the pie chart,
* so it can catch paint callback and pass it back to parent
*/
public class Canvas extends JPanel {
private IncdecPie parent;
public Canvas (IncdecPie parent) {
this.parent = parent;
setPreferredSize (new Dimension (50, 50));
}
public void paintComponent (Graphics g) {
super.paintComponent(g);
parent.drawCanvas (g); //*1 Catch this and delegate to parent, it has the info
}
}