How to pause, say press enter to continue...
Hi all,
is there any scripts or documents for pause, say press enter to continue...?
thanks
andrew
Try this:
try
byte[] b = new byte[2];
System.in.read (b);
} catch (IOException ex) {}
Similar Messages
-
How to use Press Enter to Continue
Hello
how do i use press enter to continue in my programs
can i plz have the codeK here is my code
import java.io.*;
public class asn3
public static void main (String [] args) throws Exception
DataInput keyboard = new DataInputStream (System.in);
int num = 0;
String temp;
String [] ques;
String [] a, b, c, d, e;
String [] ans;
ques = new String [5];
ques [0] = "(1) Which one of the following is an input device?";
ques [1] = "(2) Which one of the following is an output device?";
ques [2] = "(3)What does CPU stand for?";
ques [3] = "(4)How many bytes in a megabyte";
ques [4] = "(5)How many bytes in a gigabyte ?";
a = new String [5];
a [0] = "a) Printer";
a [1] = "b) Monitor";
a [2] = "c) Mouse";
a [3] = "d) Speaker";
b = new String [4];
b [0] = "a) Mouse";
b [1] = "b) Keyboard";
b [2] = "c) Scanner";
b [3] = "d) Speaker";
c = new String [4];
c [0] = "a) It does not stand for anything";
c [1] = "b) Centeral Processing Unit";
c [2] = "c) DUH!!!";
c [3] = "d) City Power Unit";
d = new String [4];
d [0] = "a) 1";
d [1] = "b) 1024";
d [2] = "c) 4096";
d [3] = "d) 1,048,576";
e = new String [4];
e [0] = "a) about 1 thousand";
e [1] = "b) about 1 million";
e [2] = "c) about 1 billion";
e [3] = "d) about 1 trillion";
ans = new String [5];
ans [0] = "c";
ans [1] = "d";
ans [2] = "b";
ans [3] = "d";
ans [4] = "d";
System.out.println ("\t\t\tWelcome to the quiz \n");
System.out.println (ques [0] + "\n\n" + a [0] + "\n" + a [1] + "\n" + a [2] + "\n" + a [3]);
System.out.print ("\nanswer : ");
temp = keyboard.readLine ();
if (temp.equals (ans [0]))
System.out.println ("\n\nCorrect!!! \n");
num = num + 1;
else
System.out.println ("\n\nWrong!!!\n\n");
System.out.println (ques [1] + "\n\n" + b [0] + "\n" + b [1] + "\n" + b [2] + "\n" + b [3]);
System.out.print ("\nanswer : ");
temp = keyboard.readLine ();
if (temp.equals (ans [1]))
System.out.println ("\n\nCorrect!!! \n");
num = num + 1;
else
System.out.println ("\n\nWrong!!!\n\n");
System.out.println (ques [2] + "\n\n" + c [0] + "\n" + c [1] + "\n" + c [2] + "\n" + c [3]);
System.out.print ("\nanswer : ");
temp = keyboard.readLine ();
if (temp.equals (ans [2]))
System.out.println ("\n\nCorrect!!! \n");
num = num + 1;
else
System.out.println ("\n\nWrong!!!\n\n");
System.out.println (ques [3] + "\n\n" + d [0] + "\n" + d [1] + "\n" + d [2] + "\n" + d [3]);
System.out.print ("\nanswer : ");
temp = keyboard.readLine ();
if (temp.equals (ans [3]))
System.out.println ("\n\nCorrect!!! \n");
num = num + 1;
else
System.out.println ("\n\nWrong!!!\n\n");
System.out.println (ques [4] + "\n\n" + e [0] + "\n" + e [1] + "\n" + e [2] + "\n" + e [3]);
System.out.print ("\nanswer : ");
temp = keyboard.readLine ();
if (temp.equals (ans [4]))
System.out.println ("\n\nCorrect!!! \n");
num = num + 1;
else
System.out.println ("\n\nWrong!!!\n\n");
System.out.println ("--------------------------------------------------");
System.out.println ("You answered " + num + " out of 5 questions correctly\n\n");
if (num >= 5)
System.out.println ("Grade A+ : You are Awesome\n\n ");
else if ((num >= 4) && (num < 5))
System.out.println ("Grade A : You did Great\n\n ");
else if ((num >= 3) && (num < 4))
System.out.println ("Grade C : You did Okay\n\n ");
else
System.out.println ("Grade F : You did Poorly\n\n ");
}just wanted to add press Enter to continue feature in the program
any more hints?
btw i have no clue about scanner class -
Press enter to continue...
hi all,
in my server /client model the clients log on and register ina vector class..since im working on distributed computing, time is important. so in my simulation, i wait for all the clients to log on and after i press enter, the server sends out the jobs.. this is how im doing..
static String name
System.out.println("press enter to continue");
try
name = br.readLine();
} catch(IOException e)
System.out.println(e);
this does work fine. but depending upon number of clients, i have press enter key so many times. how to change this, so that by pressing just once, it is updated in all the clients.? or is there a better way to do this? using may be datastreaminput(i had read it but have forgotten the website).
thank you
lsDon't know if this is actual anymore but still (I'm in a situation when I can access the net only on weekends if I'm lucky)...
You still ask the user to "press enter to continue" when ever you add a client since the codes for those two things are in the same place. You should move the code that asks for "enter" outside that method completely, that is:/* some code... */
public void addClient(frequencies obj) {
clientno = track ;
track++;
Clients.addElement(obj);
System.out.println("client added");
/* getting a handle to the callback object */
f[clientno] = (frequencies)Clients.elementAt(clientno);
client++;
sendout(client -1);
}//end of addclient
/* some more code... */
// call addClient in a loop here
System.out.println("press enter to continue");
try {
name = br.readLine();
} catch(IOException e) {
System.out.println(e);
/* and even more code... */ -
Selected boot image did not authentica​te. Press enter to continue
I just removed the stock HDD that came with my M4-1015x and now I'm trying to install windows 7 to the SSD that I replaced it with. However, upon boot up I get the message "Selected boot image did not authenticate. Press <enter> to continue" when the laptop attempts to read the OS from the disc. I've never seen this before... any help? (It's a legitimate DVD copy of Windows 7)
Thanks.
This question was solved.
View Solution.I fixed it. Had to disable secureboot and enable legacy boot mode to get it to run.
-
Message d'erreur "selected boot image did not authenticate. Press enter to continue.
Jai le Message d'erreur "selected boot image did not authenticate. Press <enter> to continue."
Jai vus dautre sujet comme cellui-ci mais moi il m'est impossible douvrir f10 poir desactiber le secure boot
Merci de vos reponseHi los,
Thank you for visiting our English HP Support Forum. We are only able to reply to posts written in English. To insure a quick response it would be advisable to post your question in English. The following links are here to assist you if you prefer to post in the following Language Forum.
English: http://h30434.www3.hp.com
Spanish: http://h30467.www3.hp.com
French: http://h30478.www3.hp.com
Portuguese: http://h30487.www3.hp.com
German: http://h30492.www3.hp.com
Korean: http://h30491.www3.hp.com/t5/community/communitypage
Simplified Chinese: http://h30471.www3.hp.com/t5/community/communitypage
Regards,
George -
ITunes 10.5 playing/pausing when pressing enter or backspace on apple wired keyboard
As above really. I'm running Lion and iTunes 10.5
My apple wired keyboard plays a song (opens itunes and plays first song) when I press enter and backspace. Hugley annoying when word processing.
It's happened once before but I can't remember what I did to fix it.
Please help if you can.
Thanks,
TobyShift and w doesn't work either. Every other letter is fine and caps lock works correctly, even with w
Any help much appriciated. -
Hi, I'm still new to using Flash and Actionscript and I was
wondering if anyone could provide me with a quick code to get the
Flash movie to stop on a certain frame and the continue when the
user hits ENTER. I've tried experimenting with Actionscript and
I've gotten the frame to stop/play but I keep getting errors when I
try to code the push enter event. Any help would be
appreciated.Put an invisible button on the stage (create a button with no
content just a small hit area). Attach this code to the button:
on(keyPress "<Enter>"){
play(); -
Pressing ENTER in Command Prompt to solve hanging
Hi,
Does anyone know why sometimes Java hangs, unless you press ENTER in the
Command Prompt for Windows 2K? After pressing ENTER it continues execution.
It happens with WebLogic sometimes too. It will not print anything on the
console until I press ENTER.
I'm sure lots of Java developers have experienced this weird problem.
Thanks,
Duke
[email protected]That is what we call a "feature" of an enterprise-class OS ;-)
Peace,
Cameron Purdy
Tangosol Inc.
Tangosol Coherence: Clustered Coherent Cache for J2EE
Information at http://www.tangosol.com/
"Chad McDaniel" <[email protected]> wrote in message
news:[email protected]..
On windows machines be very careful to turn off the "mark" option in
the shell preferences. It can halt the server.
Daniel Hoppe <[email protected]> writes:
Hi,
because you marked something in the command prompt. Marking stops
execution. Enter means 'copy' and continues execution...
Daniel
-----Original Message-----
From: Duke Nguyen [mailto:[email protected]]
Posted At: Thursday, December 13, 2001 3:16 AM
Posted To: ejb
Conversation: pressing ENTER in Command Prompt to solve hanging
Subject: pressing ENTER in Command Prompt to solve hanging
Hi,
Does anyone know why sometimes Java hangs, unless you press
ENTER in the
Command Prompt for Windows 2K? After pressing ENTER it
continues execution.
It happens with WebLogic sometimes too. It will not print
anything on the
console until I press ENTER.
I'm sure lots of Java developers have experienced this weird problem.
Thanks,
Duke
[email protected] -
When you open a new tab and begin to type a url to visit, if your mouse is hovering over any of the suggested results when you press enter, instead of firefox going to the url you have typed, it goes to the url that the mouse was hovering over.
Is there a way to disable this functionality as it is annoying when you are say, trying to access youtube or google, but then you goto a completely different page from your history because your mouse was hovering over a suggested result.@philipp:
I restarted in safe mode with all add-ons disabled and the problem still persists. Apparently a friend also seems to have this problem.
How to reproduce (to the best of my knowledge)
1) click on url bar
2) start typing part of a url which generates many results from history
3) mouse over one of the results (usually the first as thats where the mouse is after clicking on the url bar)
4) press enter with autofilled url in url bar
What happens is say that i start typing "goo" for google.com, firefox will auto complete with http://google.com, but since my mouse is hovering over a historic google search result it opens what ever my mouse is hovering over even though the url bar says "http://google.com" -
I have used FireFox to play the Game Kingdoms Of Camelot, a facebook game. I also have Grease Monkey and a 3rd party add on. I leave it running 24/7 to gather food in the game for my army. It has run smoothly for 6 mo. Yesterday 2/04/11 in the morning it started asking for conformation when the page refreshed. i want to know how to stop this Box from comeing up it will not continue without refreshing and will not refresh untill th question is answered. It says "Are you sure you want to navigate away from this page? Press OK to continue, or Cancel to stay on the current page."
You're not going to stop it, and out here, what's illegal?
What it boils down to is a matter of ethics, and it's wrong. But the web
techies build this feature into their sites because they know somebody
is going to fly in off an engine like Google or MSN. And take something,
like a picture. Without stopping in and signing up or something else.
But what if I or you is out collecting stamps or avatars or wallpapers,
and have already taken a quiz, or signed up for a product? I've already
done that...but the site developers who use this ingenious(hijacking)
software don't see it that way, and don't care if you just got a computer
and want to pick up something here or there. Those sites don't get
anything when you visit and don't leave your number. I don't what
these 19 tracking cookies are for, do you?
"A liar should have a good memory" Scottish saying -
How do you change the name of a reminder in the reminder list. I right click and then choose "get information" I can change the colour of the reminder but when I type in the name that I want and then press enter the name stays as "untitled"
Jerry,
Thanks for replying again. I've got a little bit further thanks to you. I tried the US keyboard layout as you seemed pretty definte that it should work. This time I applied the setting and also started the language toolbar and selected it from there.
Hey presto, I've got the @ where it should be. Excellent.
However the single quote ' works in a weird way. When I press it, it doesn't show up on the screen. But when I press another key, I get the single quote plus the next key I press. When I press the single quote twice, I get 2 of them. This is also the same with the SHIFT ' key. i.e. for the double quotes.
Very strange. I'll look at other keyboards and see where that gets me.
Thanks, Maz -
i was able to print with my acrobat before, but I can no longer do it. the error message says "adobe creation cannot continue because acrobat is not activated" How do I activate it?
I have the exact same issue. I can print one document and then I get the error mentionned above ("adobe creation cannot continue because acrobat is not activated"). Then I need to reboot in order to be able to print a new document.
I have suite and went to Photoshop as suggested, but this program is already activated. I tried to launch Acrobat Pro but it won't.
I'm using the Design and Web Premium CS6 Suite on Windows Vista.
Thank you so much for your help. -
How to get input values till pressing enter key
hi!!!
i need to enter values thru keyboard using bufer reader etc etc
but i need to stop entering when i press enter key
how to do this??First off I would take a look at this link because it gives quite a few good examples if you've never used scanner.
You can find all this on the link.-> http://java.sun.com/j2se/1.5.0/docs/api/java/util/Scanner.html
in order to use scanner you have to import it.
import java.util.Scanner;then inside your main method you need to create a scanner wrapped around the keyboard inputstream.
Scanner userIn = new Scanner(System.in);take a look at the api to decide which method you want. For this I would suggest nextLine().
also I would specify that you want the numbers separated by spaces or comma's or something so you can use the String.split(" "); method which returns an array of Strings;
then traverse through the array of strings and convert them to ints
http://www.rgagnon.com/javadetails/java-0004.html -
How can i select the next column instead of next row when press enter key
I need to know how can i select the next column instead of next row when i press the enter key.By default ,when i press enter key the next row is selected and the column remain unchanged but I wants opposite that is the row should remain unchanged but column index will changed.
Thanks to all.Well, the right arrow key will already move you to the next column, so the easiest way to do this is to modify the InputMap to have the Enter key invoke the same Action as the right arrow key.
You can search the forum for my "Table Actions" (without the space) example that will show you how to do this. -
Usually I just type in the address and hit enter. But lately it changed so that I have to move the mouse to an arrow on the right side of the address bar and then click.
I prefer the original method. How do i avoid having to click on the arrow?Pressing enter not working can be caused by a malfunctioning add-on. For some people this has been caused by the AVG safe search add-on, disabling that add-on has cured the problem.
The procedure in the following link can help in identifying if an add-on is causing the problem - https://support.mozilla.com/kb/Troubleshooting+extensions+and+themes
Maybe you are looking for
-
Issue while installing WCS using omii.ini: Database ping failed
Hi, I am trying to install WCS on local linux VM. I am following the document 'Oracle WebCenter Sites: Installing on Oracle WebLogic Application Server". Following are the things I have been able to do successfully: Install Oracle DB, create a databa
-
Reader 9.3 context menu dominance (wants to open all .exe files)
I didn't see this issue in the forum, so: My XP Pro SP3 install has taken over my context menu -- it placed "Read" at the top of my context menu for several different file types, including .exe, and it now attempts to open said files, which of course
-
Display drivers for MacMini OS 10.4.8
Hi, I just bought my first mac (mac mini) and I bought a Dell Ultrasharp 1907FP flat panel monitor. The VGA connector works fine and the screen is fine. However, the DVI cable gives either a black screen or a "hashed up" image (unusable). Looks like
-
hi any new update available for nokia c2-03 after 7.63
-
Producedure givng two rows instead of one row
Hi Please find below my procedure..when I execute this proc...displays two rows instead of one row. Please help me incase if I did mistake. CREATE PROCEDURE SP_CWCTravel_Cruise_Amenities_S( @Cruise_Line_Code varchar(2500) = NULL, @Shi