There are three aspects we are dealing with at this time.
We know all this - why is she saying this. Well, how do you get output
to print on each medium?
-
html pages and browsers are intimately tied together.
If you want information to show up on the browser,
you just type what
you want in the .html page. (This really should not be called "output" since output
usually means you ran a program to produce it.) Different tags will make the text appear
different on the web page on the browser. For applets, you can place
the applet at different places on the page
- Output from java programs can go to two places:
- To the Applet or Frame: on these Components for windowing provided
by Java, one needs to use various other Components (text fields, etc) or
draw to a Graphics area of the Applet using the
Applet's paint method. For example:
g.drawLine(0,0,100,100);
g.drawString("Hello World",50,50);
- To the System running the program. In java this can be either
a Browser for Applets, or the command line for Applications. For example:
System.out.println("Hello World");
will show up on the screen where you called the java program if
it is an application...or in the Java Console if it is in
an Applet. The Java Console is under the Communicator menu
choice in Netscape - perhaps it is under the tools submenu. For newer versions of Java (on windows), the applet java console shows up on the bottom menu bar as a cup with red swirling smoke).
Make sure the applet area is big enough to see all of your output.
What does that mean?
Question: Do web pages (html) use // for comments? Think about what a comment is in order to answer this.