I have been given some already complete classes by my lecturer and the idea is that I build a GUI. The project is based on an Employee class.
Among other things, I would like to add a new Employee to the array of Employees already created for me by my lecturer. The problem I have is in the way my lecturer has set the project up: I run an EmployeeTester class, and after selecting an Employee to view from a combobox, a new frame opens up called EmployeeFrame showing the Employee details. From here I have successfully created a JButton (Add Employee) which opens a JDialog to take in values of a new Employee and pass them back to EmployeeFrame where I can create a new Employee. The problem I have is that the original array of employees is back in EmployeeTester and this is where I need to add the new Employee. Is it possible to pass these details back another frame so that I can add my new Employee to the array? Can I implement some kind of listener on EmployeeTester that detects when a value has changed on EmployeeFrame?
Among other things, I would like to add a new Employee to the array of Employees already created for me by my lecturer. The problem I have is in the way my lecturer has set the project up: I run an EmployeeTester class, and after selecting an Employee to view from a combobox, a new frame opens up called EmployeeFrame showing the Employee details. From here I have successfully created a JButton (Add Employee) which opens a JDialog to take in values of a new Employee and pass them back to EmployeeFrame where I can create a new Employee. The problem I have is that the original array of employees is back in EmployeeTester and this is where I need to add the new Employee. Is it possible to pass these details back another frame so that I can add my new Employee to the array? Can I implement some kind of listener on EmployeeTester that detects when a value has changed on EmployeeFrame?
Comment