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 04:57 AM.
Last Post: 05-12-2007, 09:15 AM
By SWhockey98 in forum Java
Last Post: 09-29-2005, 04:26 PM
By DaveMere in forum Java
Last Post: 08-09-2005, 02:11 PM
By Constant in forum VB Classic
Last Post: 07-05-2002, 04:37 PM
By Wen Hsiang in forum Java
Last Post: 05-14-2000, 07:15 AM
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center