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.

Member Avatar for iamthwee

Are you using a GUI builder?

I'm using Net beans and Blue J together

Member Avatar for iamthwee

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..

Member Avatar for iamthwee

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!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.