DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2005

    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

  2. #2
    Join Date
    May 2005
    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

  3. #3
    Join Date
    Dec 2005
    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...

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

  1. How to create Setup.exe file given a Vb Project
    By cooldude.i2k in forum VB Classic
    Replies: 3
    Last Post: 08-05-2005, 03:13 AM
  2. Notepad font
    By sonict in forum Java
    Replies: 1
    Last Post: 05-29-2005, 01:17 AM
  3. wav file fade in out help
    By jase_dukerider in forum C++
    Replies: 2
    Last Post: 04-14-2005, 07:48 PM
  4. Replies: 1
    Last Post: 09-05-2002, 09:01 AM
  5. How long before the next version??
    By _CAG in forum .NET
    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
HTML5 Development Center
Latest Articles
Questions? Contact us.
Web Development
Latest Tips
Open Source

   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center

We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.