I / O Console for Java Applet

I have a console ( System.inand System.out) a stand-alone Java application. I am trying to convert it to an applet. But the problem is that there is no console in the Java applet! In other words, when I write to the system output, it is not displayed to the user, and in the same way I can not get input from the user in the absence of a console.

I know that the console view can be done with TextAreaand KeyListener, but for this I will need two different components: one for input and one for output. I want the input and output to come in the same component. Any ideas?

+5
source share
3 answers

But there is a standard console for Java applets :)

http://www.java.com/en/download/help/javaconsole.xml
http://download.oracle.com/javase/1.4.2/docs/guide/plugin/developer_guide/console.html

, , - : http://math.hws.edu/eck/cs124/javanotes2/source/index.html. , , . System.out( ), System.err( ) System.in() . , , , SecurityManager.

+3

JTextArea , DocumentEvent, , .

, , , . .

0

, Java- -, .

  • Windows + r ( )

  • "cmd" enter.

  • java -jar xx.jar xx .

! ! , , , Java, :

  • Create a new text document in which you want your startup program file to be.

  • In a text document, type:

@echo off

start java -jar xx.jar

exit

  1. Save the file as a .bat file.

Here's how you make a batch file to run your Java application!

0
source

All Articles