This week's book giveaway is in the Server-Side JavaScript and NodeJS forum.
We're giving away four copies of Node.js Design Patterns: Design and implement production-grade Node.js applications using proven patterns and techniques and have Mario Casciaro & Luciano Mammino on-line!
See this thread for details.
Win a copy of Node.js Design Patterns: Design and implement production-grade Node.js applications using proven patterns and techniques this week in the Server-Side JavaScript and NodeJS forum!
  • 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
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

Console in Applet

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Rancher
Posts: 43026
76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 43026
76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
reply
    Bookmark Topic Watch Topic
  • New Topic