Campbell Ritchie wrote:Welcome to the Ranch
I am sorry to tell you, but you should get rid of the frame. And the windows. Ditch the GUI entirely … at least for the time being. What you should do, is get that application working as a console application. Get your tutoring class working, with lots of methods which allow you to enter time, get charges, etc. Get that working so you can call it from another class’ methods and print out the results on the command line/terminal. Then you can create a GUI to go on top of that.
Don’t put any application code in the GUI. The GUI calls the app and displays it. It does not do any arithmetic, recording, etc.
You have been told you have a 2D array, but you ain’t, because there ain’t no such critter. Note cowpoke grammar used on the Ranch What you have is an array or arrays, which is different from a 2D array, and better.
But why are you using arrays like that? Why don’t you have a TutorSession class which encapsulates the time and cost? You can even have a per‑hour field in that class, which allows it to do the arithmetic for you. You can have a Tutor class which has a TutorSession[] as a field. You can even fiddle things so you can get the first session by entering 1 and find sessions[0].
You should also go through the Java Tutorials and read about text components. Some of them support multiple lines and some only support a single line.