changed passed paramters to subpanels. Changed invalid references. Implemented working windowlistener. Properly dispatched of events