Communication between classes
For school, I am asked to write a program in Java. The program should arrange for a barrier (up and down moving thingy at the beginning of i.e. a parking lot) to open or close.
The opening and closing, I can manage. It's just writing bits to a paralel port, using a library I already have.
The program also has to have a GUI. No probs, also that was easy. Now for the problem: the program should start with a class named Manager. This should initiate the GUI.
The barrier and the GUI should run in two different threads (problem number one, but I think I can figure that out).
The biggest problem is: How do I get the manager to see input (i.e. a clicked button) on the GUI and how do I let the manager call the appropriate function on to class ParaController (the controller of the barrier, which has the functions barrierOpen() and barrierClose().
Could someone show me (pseudo code should do). I've tried making the manager class a parent and the GUI a child, but I still don't get it.
Last edited by frits.theunis; 05-03-2006 at 03:57 AM.
Last Post: 05-12-2007, 08:15 AM
By SWhockey98 in forum Java
Last Post: 09-29-2005, 03:26 PM
By DaveMere in forum Java
Last Post: 08-09-2005, 01:11 PM
By Constant in forum VB Classic
Last Post: 07-05-2002, 03:37 PM
By Wen Hsiang in forum Java
Last Post: 05-14-2000, 06:15 AM
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL