-
How do I create a Class file which prints out a menu?
Hey all, new around here...
I would be making a menu with sub-menus. As I didn't want my codes to be too messy... I was thinking of making a class for my sub-menus... Now, I think this is possible... But not too sure on how to do it... Could someone give me some tips here?
Thanks in advance
-
I'de say create a super abstract class call it 'menu' or somthing like that.
it will have to hold a variable that's conected to it's father menu, and an array for it's sub menu.
then everytime you need aditional sub menu simply inheret the super class.
somthing like that:
public abstract class Menu(){
protected Menu father;
protected Menu [] children;
// all other variables
public Menu(){....}
// and all the neccesary functions
}
-
Hmm... Sorry... I am still fairly new to java, haven't touched on super abstract class yet... Don't think I would know how to use it...
I have done my main menu looping, just need to get the sub menu done... But not sure on how to create my submenu class and how to use my my main to call out the sub menu...
Was thinking something like...
if(choice==2)
//this is where i would call out the submenu class...
But not too sure on the code on how to call it out...
Sorry, I am still very new to this... Thanks for your patience and time
Similar Threads
-
By cooldude.i2k in forum VB Classic
Replies: 3
Last Post: 08-05-2005, 03:13 AM
-
Replies: 1
Last Post: 05-29-2005, 01:17 AM
-
By jase_dukerider in forum C++
Replies: 2
Last Post: 04-14-2005, 07:48 PM
-
Replies: 1
Last Post: 09-05-2002, 09:01 AM
-
Replies: 146
Last Post: 08-12-2002, 10:40 PM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks