473,382 Members | 1,622 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Console Programs

Hi,

I was just wondering what classes/methods are used to clear the screen
of the console. Also, how can you take input from the keyboard so that the
enter key need not be used. ( e.g. the arrows for a snake-race game )

Thanks,

Patrick Brown
Jul 17 '05 #1
2 4182
There is no general Java way to do fancy screen control, because Java was
not intended for this kind of purpose. You may be able to send ANSI escape
sequences, but not all operating systems understand them.

You should be able to read one character at a time from System.in. The one
thing to watch out for is that System.in may be buffered.

Of course, if your operating system already processes data on a
line-by-line basis rather than character-by-character (both Windows and
Unix do by default), then you might have to turn that off first.

On Fri, 01 Aug 2003 17:26:02 +0000, Patrick Brown wrote:
I was just wondering what classes/methods are used to clear the
screen
of the console. Also, how can you take input from the keyboard so that
the enter key need not be used. ( e.g. the arrows for a snake-race game
)


--
Keep American Families united! Support H.R. 539 and H.R. 832
For more information, see http://www.kkeane.com/lobbyspousal-faq.shtml

Jul 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Will Stuyvesant | last post by:
I never used the popen or popen2 libraries but it is my understanding that they can capture the output of console based programs. Is it also possible to send keystrokes to console base programs? ...
0
by: Edward | last post by:
Hello, I just finished taking a basic C++ class in High School eariler this year. For the most part we worked with DOS programs in the Win32 console application in Visual C++ 6.0. I've done a...
2
by: glean | last post by:
My console in WinXP is using Lucida Console for the font. My problem is, I can go to character map and select a string of special characters such as the following: ®¾Öþ¬«§¯ I can paste them into...
5
by: Barry Mossman | last post by:
Hi, can I detect whether my class is running within the context of a Console application, vs say a WinForm's application ? also does anyone know whether the compiler or runtime is smart enough...
2
by: _R | last post by:
I've got a few apps that were designed to be used via MSDOS window. They make use of the old-style VC++6 Console class for doing writes, cursor repositioning, scrolling, etc. (Unfortunate name...
8
by: Terry Olsen | last post by:
Can console programs do events? Or are they strictly linear programs?
4
by: eglaser | last post by:
Hello, I have a script that launches a sequence of other programs, some GUI, some console. I'd like the console programs to launch in their own console window, instead of all of them sharing...
5
by: =?Utf-8?B?SmFtZXMgV29uZw==?= | last post by:
Dear all, I'd like to know if there is any method to minimize command mode window when a console program is running. In my case, there are several console programs which run periodically in...
27
by: CarlosMB | last post by:
Hello, I am writing code that uses a DLL which is supposed to print to console some useful information but for some reason it is not doing so. The environment is a bit complex to explain but...
5
by: jacob navia | last post by:
One of the many questions asked by people is that even if they write into standard output, the output doesn't show in the screen. This happens in windows systems since quite a long time. To...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.