Re: Java Gurus Help



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)

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


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

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-)
.



Relevant Pages

  • Re: Object oriented
    ... As for my programming experience - I programmed a lot years ago, ... You can create applications as .HTA files quite easily. ... paste in the HTML code and save it to a ... That basic HTA page doesn't do anything except open a blank window. ...
    (microsoft.public.scripting.vbscript)
  • Re: New application - Word Calc
    ... After a busy week of programming, I've pleasure in announcing yet another ... I have just found that my suggestion below already exist in!Bitmanip ... Can I suggest another Calc program that would be useful for me developing ... a small unobtrusive window. ...
    (comp.sys.acorn.apps)
  • Re: Ada for 1st year students
    ... GNAT GPL Edition and Debian both come with the GNAT Programming ... not just the same old text output on a teletype-like window.) ... support for input, e.g. textboxes, buttons, mouse input. ...
    (comp.lang.ada)
  • Re: Havent done anything real with OOP yet.
    ... > done a lot of small beer programming in Igor Pro for data analysis. ... > The program starts with a clam standing on the beach. ... > covering the old and new clam positions into the working window, ...
    (comp.object)
  • Re: Bug in win xp: Auto-detaching modeless dialog.
    ... some long time, it will be overlayed by a "ghost" window, with white ... This "ghost" will allow to kill the runaway task. ... > suspect programming ... > The whole loop with a sleep in it is a colossal blunder. ...
    (microsoft.public.vc.mfc)