Hi guys,
I have a problem in a GUI i am trying to build. Below is the question and I was hoping you could help me out with what to do. Basically, I have do the first program which is to create a GUI but I am having a problem with what to do in the second program, In terms of the menu. Please help me out here. Thanx a lot...

The problem
The task is to write two programs. The first will provide a GUI which lets
the user enter and save recipes, where a recipe has the form
NAME
INGREDIENT1 : QUANTITY1
...
INGREDIENTn : QUANTITYn
where the quantities are right for one person, e.g.
Omelette
egg : 1
butter : 0.25 oz
Spaghetti carbonara
spaghetti : 2oz
bacon : 1oz
egg : 1
The GUI should allow the user to add an arbitrary number of ingredients,
and it should be possible to use any measure the user likes when specifying
quantities (so it should be possible to say that a recipe requires 1 oz of butter
or that it requires 28 grams of butter), though the user should stick to the
same units for the same ingredients (so they should not have one recipe that
requires 0.5 pints of milk and another that requires 0.6 litres of milk).
The second program will read a collection of saved recipes and then let the
user specify a set of menus, and will produce an appropriate shopping list
for the given set of menus, e.g.
Omelette: 2 people
Spaghetti carbonara: 4 people
should produce the list

egg : 6
bacon : 4oz
spaghetti: 8oz
It is very likely that you will want to represent recipes as serializable objects
and save/restore them using ObjectOutputStreams and ObjectInputStreams.
Other approaches to the problem will not be marked down, but this seems
like a good way to proceed.

In that case you plan what your GUI looks like in netbeans.

Just drag and drop the buttons etc. Then create event handlers for them.

Next, and prolly the most difficult is to create the back end.

Classes and such etc.

Post your code if you're stuck.

Ok i would have to post my code here moro as I have it on my school system. I have done the GUI.. The problem is the higlighted part which is the second program. The menu bit.. I dont know what to do there..

Ok i would have to post my code here moro as I have it on my school system. I have done the GUI.. The problem is the higlighted part which is the second program. The menu bit.. I dont know what to do there..

Try first then I'll help you. Good luck!

This article has been dead for over six months. Start a new discussion instead.