• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to CODE in JAVA?

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a statement like "show name"

If i will type in dos prompt as bellow and press "TAB" key it should show full statement.

Example :

C:\manoja> show "press TAB Key"

it should show like

C:\manoja> show name
 
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
First, huh? And second, this sounds more like a Java question than Java News. So I am going to move this to the Java In General Beginner's forum...
 
Ranch Hand
Posts: 808
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't see the Java part of this question. Could you please rephrase as a question involving Java?
 
Manoja
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Question is :

How to write a java code which will do following.

When ever i will start typing in command prompt, after typing half of the word if i will press a key like <TAB> it should show complete word or sentence.

Example:

Suppose i have a statement "show your name". And i will do like bellow.

C:\DOS>show <press TAB KEY>

It should display "show your name" in command prompt itself as.

C:\DOS>show your name
 
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is not Java specific!
I am assume you're using windows because you mention the command prompt.
This functionality is only available in Windows XP if you are using anything earlier than that you have to make do with typing the doskey command and press the UP or DOWN arrows to access previously typed commands!
Barry
 
Jeff Bosch
Ranch Hand
Posts: 808
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It's not only not Java-specific, it has nothing to do with Java at all, not unless you want to write a command shell in Java but I see no point in doing that.
 
Manoja
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I understand that nowhere it is related to java. But I was trying to know, can we do this in java. As Jeff Bosch told for that we have to write a command shell in java. Fact is no point writing command shell in java.

Thanks
Manoja Brahma
 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Check this for java coding conventions http://java.sun.com/docs/codeconv/


Originally posted by Manoja Brahma:
I have a statement like "show name"

If i will type in dos prompt as bellow and press "TAB" key it should show full statement.

Example :

C:\manoja> show "press TAB Key"

it should show like

C:\manoja> show name

 
Bartender
Posts: 1844
Eclipse IDE Ruby Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Manoja Brahma:

Can we do this in Java? Are you asking if we can do this in Java when entering text through a console-based program? That seems to the only way that I make sense of the question. If so, the answer is no -- not with the system's console. You would have to write your own console that listens for the TAB key.

Barry Higgins:

Actually, on prior Windows systems, type "regedit", and go to "HKEY_CURRENT_USER\Software\Microsoft\Command Processor\Completion Char" and set the value to 9, then you get tab-completion in pre-XP systems. (The earliest that I know it works is NT 4; I don't know about 95 or 98)

R S B:

Your name does not conform to Java Ranch naming policy You can keep the initials for the first name if you like, however, we would appreciate it if your last name was spelled out. You can change it here
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic