dcsimg
up-arrow key that return the previous command in java-command line.
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   joe_sugi
Posted On:   Thursday, August 9, 2001 05:28 PM

How can I used the up-arrow key to return the previous command in java-command line?

Re: up-arrow key that return the previous command in java-command line.

Posted By:   Dermot_Hennessy  
Posted On:   Friday, August 10, 2001 02:12 AM

For starters, I am assuming that by 'Java command line', you mean that you have devised a Java command line interpreter of some sort.

That assumption made, you will probably need a thread to maintain a list of the last entered commands, and to listen for the up arrow key and other special keys being pressed. There is a java.awt.Event variable which represents the up arrow key having been pressed .


When you receive an up arrow notification, simply unravel your list of previous commands.

Come to think of it you possibly don't need a separate thread...

Dermot

About | Sitemap | Contact