• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to display users input to console  RSS feed

 
yunus emre güney
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi im trying to build a console ( like windows cmd ).I guess i did the gui stuff correct but i cant carry users input to console.I mean if user types hello and enter console should display it.There are 2 classes one is the main other is console.


This is the console class:


I dont really know what to write inside `actionPerformed`. My main aim is to build a console which will understand commands and do stuff with them. Thanks
 
Knute Snortum
Sheriff
Posts: 4274
127
Chrome Eclipse IDE Java Postgres Database VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If I'm understanding you, why not use System.out.println()?
 
yunus emre güney
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Knute Snortum wrote:If I'm understanding you, why not use System.out.println()?




im tryng to do somethng like that
 
Fred Kleinschmidt
Bartender
Posts: 571
9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In  your input ActionListener actionPerformed() method you just need to add the text to the "console" component.
However, you will find that creating a GUI "console" is much more difficult than you might imagine. You also need to ensure that the scroll pane scrolls to the bottom so you can see the result. And then there is the problem of what to do with the possible output of the command you enter: how do you know when the command's output has ended?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!