When user starts the application login.java is invoked and the user get appropriate menu like admin_menu.java or user_menu.java.

I have added an option to change password in admin_menu.java and user_menu.java.

How to pass user-id from login.java to admin_menu.java and user_menu.java
after successful login.

Any idea , please help.

12-18-2009, 04:36 PM

zweibieren

Quote:

login.java is invoked and the user get appropriate menu like ...

Information can be passed from one class to another
via a method call, a command line string, or through a file.
It all depends on how control is passed from login.java to the menu.

Let's assume you are making a new admin_menu or user_menu.
I recommend creating another class of object just to keep the userId
and other global information. The login class creates one of these
communication objects and passes it to any children.
Children can then access the global data from the object.

12-22-2009, 09:19 AM

mkkrish

Thank you.

If it is possible , can you please give and example (very small).

sothat I can incorporate the same idea. Now I have login program. I am listing it here. Kindly show what should be done to pass the use_id to
adm_menu.java and clk_menu.java.