Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 How to make menu's
Index -> Programming, Java -> Java Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
bodbwoii




PostPosted: Wed Jan 06, 2010 8:32 pm   Post subject: How to make menu's

heyy; java beginner. doing a school project and i need to know ow to make a menu with 8 options
any ideas?
Sponsor
Sponsor
Sponsor
sponsor
DemonWasp




PostPosted: Wed Jan 06, 2010 8:50 pm   Post subject: RE:How to make menu\'s

Text. Output options in some specific order, prefixed by numbers. Ask them to choose the number of their choice. Act on choice.

Exit gracefully when done.
bodbwoii




PostPosted: Wed Jan 06, 2010 10:24 pm   Post subject: RE:How to make menu\'s

huh?
TheGuardian001




PostPosted: Wed Jan 06, 2010 11:20 pm   Post subject: Re: How to make menu's

Those were instructions for a text menu, in the console.
1) Output a list of options, which are numbered.
code:

    Please choose an option:
    1) option1
    2) option2
    3) option3
    etc...

2) Receive user input, and react accordingly.
code:

    choice = User_input
    if (choice == 1)
        do stuff for choice 1
    else if (choice == 2)
        do stuff for choice 2
    else if (choice == 3)
        do stuff for choice 3
    etc...
    else
        User is an idiot.


Unless of course you want a non console based menu, in which case you just add an ActionListener to a Button, JButton, or any other awt/swing widget you care to use.
Display posts from previous:   
   Index -> Programming, Java -> Java Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 4 Posts ]
Jump to:   


Style:  
Search: