Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Console in Applet

 
Gid Gold
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey all,

I'm been coding java for a while (text-based console programs only), and now I want to try out the applets. Here is the thing though, I'm not interested in graphics. I would like to run a "console" like environment on my webpage. I.e., just a big black box, where the user can input at a prompt, and run a program textually.

I'm new to applets, can you guys please help me out? I can't find the information anywhere. Thanks.
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to JavaRanch.

What would be the advantage of mimicking a command line in a web browser when the OS already has a perfectly good one?

The point of applets is to present a GUI (it extends Panel, after all); if you're not interested in GUIs, then applets probably are not for you.

I suppose you could just have a single large TextArea in it, and somehow interpret any text the user types into it, and also use it for output, if you're really set on foregoing a GUI.
 
Gid Gold
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I know that, but I also do web design and just wanted to get the "terminal" effect on my web page. It's not for functionality, its for style. Anyway, so thats what you'd recommend, just working with a large text box?
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, I would recommend against that. One of the advantages of Java is that it makes it easy to program GUIs, so that's what I would do. These days I see more and more people who don't know the command line, and are actively shying away from them. It's been quite a while that I considered a CLI as the primary interface to an application.
 
Gid Gold
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, I didn't really get any help, but I figured it out on my own in case some of you are interested.

Basically, you can of course write it urself, or use some existing classes. ConsoleApplet, ConsolePanel, and ConsoleCanvas are the 3 you need for basic console emulation. There are many more (also non-java standard) console related classes which you can experiment with. These are a great starting place for achieving a console effect in an applet.

Gideon Goldin
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic