basic java help

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • ochulus

    basic java help

    hello! I'm fairly new to java and we're still doing text-based java stuff at
    school. I just need a bit of help for a project. I know how to read input
    from the keyboard (e.g. entering a person's name). However, how do I
    implement something like "Press ENTER to continue" or "Hit any key to
    continue"? I've been looking at the Java API documentation but I really
    don't know what I'm looking for. Thank you!

    pras


  • Oswald

    #2
    Re: basic java help

    I'm new at Java too, but I think asking for a dummy would help...

    Instead of saying: "Enter name: ", you can say: "Press enter to continue"
    and use String dummy instead of String name...

    Hope this helps,
    Oswald


    "ochulus" <endorphin_mach [email protected]> wrote in message
    news:gU3ib.1470 71$bo1.97171@ne ws-server.bigpond. net.au...[color=blue]
    > hello! I'm fairly new to java and we're still doing text-based java stuff[/color]
    at[color=blue]
    > school. I just need a bit of help for a project. I know how to read input
    > from the keyboard (e.g. entering a person's name). However, how do I
    > implement something like "Press ENTER to continue" or "Hit any key to
    > continue"? I've been looking at the Java API documentation but I really
    > don't know what I'm looking for. Thank you!
    >
    > pras
    >
    >[/color]


    Comment

    • Nicholas Geraldi

      #3
      Re: basic java help

      Greetings Oswald,

      I am by no means an expert but here is what i would generally do.

      your input method causes the program to pause waiting for input, so if you
      just read in a string and throw it away( i dunno how you are reading in
      lines, if you could post that i would give you an exact example ). so
      soemthing like

      System.out.prin tln("Press [Enter] to continue");
      String fake_string = [read_in_method]();
      {rest of your program}

      that should pause your program until someone hits enter

      Hope that helped,
      Nick


      "Oswald" <fluffster71@ho tmail.com> wrote in message
      news:3f89c18e$0 $15663$ba620e4c @reader1.news.s kynet.be...[color=blue]
      > I'm new at Java too, but I think asking for a dummy would help...
      >
      > Instead of saying: "Enter name: ", you can say: "Press enter to continue"
      > and use String dummy instead of String name...
      >
      > Hope this helps,
      > Oswald
      >
      >
      > "ochulus" <endorphin_mach [email protected]> wrote in message
      > news:gU3ib.1470 71$bo1.97171@ne ws-server.bigpond. net.au...[color=green]
      > > hello! I'm fairly new to java and we're still doing text-based java[/color][/color]
      stuff[color=blue]
      > at[color=green]
      > > school. I just need a bit of help for a project. I know how to read[/color][/color]
      input[color=blue][color=green]
      > > from the keyboard (e.g. entering a person's name). However, how do I
      > > implement something like "Press ENTER to continue" or "Hit any key to
      > > continue"? I've been looking at the Java API documentation but I really
      > > don't know what I'm looking for. Thank you!
      > >
      > > pras
      > >
      > >[/color]
      >
      >[/color]




      -----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
      http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
      -----== Over 100,000 Newsgroups - 19 Different Servers! =-----

      Comment

      Working...