Results 1 to 5 of 5
  1. #1
    udinulis's Avatar
    udinulis is offline Member
    Join Date
    Jul 2010
    Location
    earth
    Posts
    8
    Rep Power
    0

    Smile how to make command prompt in java

    need your help please, i want to make an application like command prompt (windows terminal) in java, but my project does't goes well because my JTextArea would't listen my command :) . can action listener implemented in jtextArea, or maybe other component in java could make this work...
    i will appreciate any your help


    matur nuwun...

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,306
    Rep Power
    25

    Default

    i want to make an application like command prompt
    You want a text area to be where commands are entered and responses displayed?
    When you enter a "command" in the text area and press Enter, you want a listener to read what was entered in the text area, do the "command" and display the results in the text area.
    What listener are you using for the text area? Can you show your code?

  3. #3
    udinulis's Avatar
    udinulis is offline Member
    Join Date
    Jul 2010
    Location
    earth
    Posts
    8
    Rep Power
    0

    Default

    sorry for my late response...
    i was trying search in google about action listener in jtextarea, but couldn't found what i want. about the command, i use the top down parsing method for the program.

  4. #4
    berkeleybross's Avatar
    berkeleybross is offline Senior Member
    Join Date
    Feb 2010
    Location
    England
    Posts
    187
    Rep Power
    5

    Default

    Have you looked at javacc? Its quite a powerful parser compiler.

    As to your text area you need to make a document and override its insert method. This will tell you what character(s) are being entered - so you can detect the enter key.

  5. #5
    udinulis's Avatar
    udinulis is offline Member
    Join Date
    Jul 2010
    Location
    earth
    Posts
    8
    Rep Power
    0

    Default

    ok, thank's for your info. btw i have make a progress for my project. i am using documentListener to my program. thank's you all

Similar Threads

  1. running command prompt using java
    By xclaim in forum New To Java
    Replies: 1
    Last Post: 01-14-2010, 03:46 AM
  2. Command Prompt Java
    By kelvinsmj in forum New To Java
    Replies: 8
    Last Post: 11-27-2009, 10:30 AM
  3. how to run windows command prompt in java parogram ?
    By indikasampath2000 in forum AWT / Swing
    Replies: 4
    Last Post: 12-16-2008, 06:51 AM
  4. Replies: 2
    Last Post: 12-03-2008, 01:24 PM
  5. accessing command prompt using java (netbeans)...
    By kureikougaiji in forum New To Java
    Replies: 6
    Last Post: 06-27-2008, 03:01 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •