I am a total
Java newb looking for some guidance.
Background
I am making an App for a course I am taking. It has a gui that allows some input of payment and minutes spent for a tutoring session. Then it will also display a report of sessions, etc.
Anyway -- I made a class (GUI) and built the GUI.
And I made a class (EarningsBucket) with a 2d array to hold the minutes and payment amounts. I made a method to record a session.
Then I have a Main class with my Main method, that I use to create an earnings bucket object, and then create and display the GUI.
Question
So I was trying to update the actionlistenter for the "Enter Session" button, that will take the values from the input fields for minutes and payment, and run the method to enter the session into the EarningsBucket object.
But the actionlistener
(as I have it now anyway based on an example GUI from my book) is an internal class in the GUI JPanel Class where I build the GUI, and I cant seem to access the earningsbucket object from in there.
(Even after making the variable that holds it in the Main Class public)
Anyway -- any input would be helpful. I may be approaching the problem all wrong -- in which case, please point me in the right direction.
PLEASE DO NOT RESPOND WITH SPECIFIC CODE. Though examples/skeleton code to convey a point or approach is fine.
In case anyone wants to see -- here is what I have so far
Main
Earnings Bucket
GUI