I am trying to make a new booking sheet for my work (fitness instructing).
Anyway, I got some GUI stuff going on, some work some dont yet. but I am looking for the best way to implement some aspects of the program.
I will try to show images. Here is what the program looks like:
and I would like the sheet area to have a booking sheet like this, if possible:
But I need to be able to store, Name & Member Number as a string on the sheet, and also store if that booking is an induction/program so ints for this. I also want to store how many of each induction/program per day, so that the day picker can select dates and calculate how many people were inductions/program.
The most important thing is to break the problem down. Divide things into modules that are as independent as you can make them, and work on the modules separately, testing them often both separately and together.
Coarsely, I'd divide the whole program into three chunks:
Data structures to store sheets and events
A storage module to save and load instances of these data structures
A GUI to let the user interact with the other two modules.
When you say things like "I need to be able to store, Name & Member Number as a string on the sheet, and also store if that booking is an induction/program so ints for this. I also want to store how many of each induction/program per day, so that the day picker can select dates and calculate how many people were inductions/program" you're mixing these three quite distinct functions all together, and that's not good -- it leads to messy, hard to understand code. Instead, think of them separately: what goes into the data structures; how the load/store machinery will work; and what methods the GUI will call on the other parts to make things happen.
And compile and test often -- never go more than a minute or two without compilable code. The more code you write without compiling, the more time you spend randomly hunting for bugs!
I know what your saying, I have been doing this for the GUI part of the program. I found this to be very challenging but rewarding.
I was giving a break down of what the program is to do. I know it sound a lot, but it is not really.
I think what I am looking for help on, is: Can the sheet look like the image above yet still accept strings only in the spaces? if so how? And what would be the best way to store the booking sheet, as I would need to store everyday?
I really don't want people writing my code, but I am looking for pointers in the right direction on what to use. as I don't know that whole language, only enough to have passed the exam, which was 1.2 but learned 1.3 and got HFJ 2.0 covering 1.5.
I made the GUI first as I thought it would be easy to add in classes/methods to work on the buttons, after they work on their own.
Thanks again Ernest, and thanks for anyone else who can steer me in the right direction.
davy [ February 27, 2007: Message edited by: Davy Kelly ]
Joined: Jan 12, 2004
I wonder if you could give me your opinions on this idea for the booking sheet:
make a panel that holds JTextFields for the time part and JTextAreas for the part to book people in
so make the each row as a separate area, and load all of those areas? a bit like this excel image: