import java.awt.*; import java.util.*; import java.applet.Applet; public class MagPuz extends java.applet.Applet { MagCan magcan; MagControls magcontrols; public void init() { //Make the 2 main Frames magcan = new MagCan(this); magcontrols = new MagControls(this); //Set Layout FOR 2 Frames this.setLayout(new GridLayout(2,1,10,10)); //Add Panels add(magcan); add(magcontrols); } //This Function handles the update of colors from the Control Frame. //Hopefully this function is self-evident. void update_jamcolor(String choice, String col) { Color theColor = Color.black; if (col.equals("Blue")) theColor = Color.blue; else if (col.equals("Red")) theColor = Color.red; else if (col.equals("Green")) theColor = Color.green; else if (col.equals("Black")) theColor = Color.black; else if (col.equals("White")) theColor = Color.white; magcan.updatecolor(choice, theColor); } }