Re: Java Gurus Help
- From: IchBin <weconsul@xxxxxxx>
- Date: Sat, 11 Mar 2006 14:19:01 -0500
Andrew Bell wrote:
I'm doing a uni course in the UK and one of my semesters is about programming. This is just going to be compilied and executed with no menu just using command promt (javac classfile.class)As for the selection of one menu, with (1,2,3,4,5,6) options, that displays a another menu, with (A.B.C.D.E.F) options, does not seem to make sense. You can not have one menu option popup another menu unless it is a popup menu but that can not be what you mean..
I am not that good at programming but what I need to know is in java how would i do this..................
menu appears, user selects menu option (1,2,3,4,5,6) a new menu appears after selecting option 1 asking the user to select another option (A.B.C.D.E.F)..... What I need to know is will this be a IF statement........
If (Variable1 = = '1')
{
do this line
{
if (Variable = = '2)
do this line
(
if (Variable = = '3')
{
do this line E.T.C for each variable.
What i need to do is let the user choose from the first menu and then be able to select a second menu, but i dont no how to call the second menu for more than option 1, so if a user selects 2 how do i call it aswell. ? I hope you can understand what I mean. If not then please ask me what you need to know and i will try and help to help you understand what i mean.
Thanks
Are you not sure that you have one window with a menu that you can select options (1,2,3,4,5,6) that opens a new window that has it own menu with the (A.B.C.D.E.F) options, the user can select?
You have to explain it better than you just did? Can not help you because it is not clear.
As for the if statement. It can be coded three different ways depending on the var Type:
If (stringVar.equals("1"){
}
else if (charVar == '1'){
}
else if (intVar == 1){
}
You can also use a SWITCH statement instead of a if statement.
I can point you to some docs and examples but, like I said, you have to explain your homework in a understandable fashion. I will not give you the exact code but can point you to what you have to do and with what API's.
http://javaalmanac.com/egs/javax.swing/Menu.html
Here is a source for information. Also another link to examples that may help with programming menus.
http://java.sun.com/docs/books/tutorial/reallybigindex.html
Thanks in Advance...
IchBin, Pocono Lake, Pa, USA http://weconsultants.servebeer.com/JHackerAppManager
__________________________________________________________________________
'If there is one, Knowledge is the "Fountain of Youth"'
-William E. Taylor, Regular Guy (1952-)
.
- Follow-Ups:
- Re: Java Gurus Help
- From: Andrew.Bell
- Re: Java Gurus Help
- References:
- Java Gurus Help
- From: Andrew Bell
- Java Gurus Help
- Prev by Date: Java Gurus Help
- Next by Date: Re: Java Gurus Help
- Previous by thread: Java Gurus Help
- Next by thread: Re: Java Gurus Help
- Index(es):
Relevant Pages
|
|