Page 1 of 1
Clear Screen? Using a program w/o editer
Posted: Tue Mar 09, 2004 12:33 pm
by Sherwoodforestdude
Posted: Tue Mar 09, 2004 4:07 pm
by talleyrand
0) Try the Java forum
1) System.out.println(""); //or do something like String clear = "\n\n\n\n..."; and call System.out.println(clear)
2) I assume you are asking how to run a java app without TP? javac MyFile.java will compile it, java MyFile (no extension even though javac will produce a MyFile.class file)
Posted: Wed Mar 10, 2004 7:23 pm
by Sherwoodforestdude
Thanks, i was thinking of the"\n" thing myself.
but how will i carry out step 2
"2) I assume you are asking how to run a java app without TP? javac MyFile.java will compile it, java MyFile (no extension even though javac will produce a MyFile.class file"
what do i do to create to do this appelet. The teachers (even the ap ones lol) have no clue how to do this in java

-Cs
Posted: Thu Mar 11, 2004 4:44 am
by talleyrand
Running an applet is a different animal than running a java application. Which are we talking about?
At either rate, compilation is the first step. To compile your source code (human readable file) into byte code, run it through the compiler (obviously). The command to do so is
If I were to look in that directory (dir \sandbox or explorer /e,C:\sandbox), I'd see at least two files (assuming the code was syntactically correct). My source code (WizBang.java) and the byte code (WizBang.class and any inner classes but since this is an intro course, we'll leave them be).
Now, I'm ready to run my code. If it's an application, I will invoke the java virtual machine (JVM) on it via the java command
The rules appear to have changed (or I was ignorant of them) but to get an applet to run, in my day (2000) you needed to provide an HTML wrapper for the applet call. Then either point your browser to the HTML file or call the appletviewer. Since answering other applet questions in this forum, I did some testing and at least for me, it seems the requirement of writing the wrapper has gone to the wayside if you run the applet via the appletviewer. Thus
Code: Select all
C:\sandbox>iexplore WizBang.html
or
C:\sandbox>appletviewer WizBang.html
or
C:\sandbox>appletviewer WizBang
all seemed to produce the same results on my machine. At least, I'm pretty sure they did. I can't find where I put the files and I'm too lazy/hate applets too much to recreate them.
All of the aforementioned code assumes the current directory (.) is in the classpath and that the Java binary tools directory and possibly Internet Explorer is in your executable search path.
Posted: Thu Mar 11, 2004 4:50 am
by talleyrand
Oh and WizBang.html would look something like
Code: Select all
<html>
<head>
<title>Foo</title>
</head>
<body>
<applet code="WizBang.class" width="480" height="640" align="left" />
</body>
</html>
Posted: Tue Mar 16, 2004 12:36 pm
by Sherwoodforestdude
I have no clue what you said. I dont know which is your compiler or which is your file. So basically tell mewhat to do using the file MyProgram
Thanks
Posted: Wed Mar 17, 2004 11:50 am
by ramonsky
What exactly has any of this got to do with TextPad?
If you want to learn Java, this forum is not really the right place.