... Checkbox("The Adventures of Javaman", group, true);
checkbox2 =
new Checkbox(" ;Java by Example& quot;, group, false);
checkbox3 =
new Checkbox(" ;Java and the Single Guy", ... Checkbox("The Adventures of Javaman", null, false);
checkbox2 =
new Checkbox(" ;Java by Example& quot;, null, false);
checkbox3 =
new Checkbox(" ;Java and the Sing...
... Controls
CONTENTS
Choice Menus
Example: Creating a Choice Menu❍
Choice Menu Methods❍
Example: Responding to Menu Events in an Applet❍
●
Scrolling Lists
Example: Creating a Single-Selection List❍
Example: Creating ... MenuBarApplet's frame window and menu bar.
Listing 23 .4 MenuBarApplet .java: An Applet That Uses a Menu Bar.
import java. awt.*;
import java. applet.*;
public cla...
... 16 .4 shows the applet running under Appletviewer.
Figure 16 .4 : This is RectApplet running under Appletviewer.
Listing 16.1 RECTAPPLET .JAVA: Drawing Rectangles.
import java. awt.*;
import java. applet.*;
public ... Canvas●
Example: Using the Coordinate System●
Drawing Shapes●
Example: Drawing a Rectangle●
Example: Drawing Other Shapes●
Understanding the ShapeApplet Applet
Drawing...
... source is a string.
Example: Reading a File
There are many ways to read files using Java& apos;s I/O classes. The most basic, however, is to read a file
byte -by- byte. Suppose, for example, you wanted ... data. Figure
36 .4 shows FileApp's output.
Figure 36 .4 : The FileApp application reads and displays a text file.
Listing 36 .4 FileApp .java: An Application That Reads a File.
i...
... the original Java- compatible Web browser.
java
This is the Java interpreter, which runs applets and
applications by reading and interpreting byte-code .CLASS
files.
javac
This is the Java compiler, ... Netscape Navigator.
Listing 33 .4 ArcApplet .java: An Applet Prepared for Javadoc.
import java. awt.*;
import java. applet.*;
/**
* ArcApplet demonstrates drawing arcs by enabli...
... which the class's
source code is stored.
4.
At the MS-DOS prompt, type javac DisplayClass .java. Java& apos;s compiler then compiles
the DisplayClass .java file, creating the DisplayClass.class ... source code in a file with the .java extension. Then you use the Java compiler, javac,
to compile the source code into byte-code form. Just like a normal class, the byte-code file will...
... do-while Loops
CONTENTS
The while Loop
Example: Using a while Loop❍
Example: Using a while Loop in a Program❍
●
The do-while Loop
Example: Using a do-while Loop❍
Example: Using a do-while Loop in ... for Loop●
Example: Using a for Loop●
Example: Using a for Loop in a Program●
Changing the Increment Value●
Example: Looping with Different Increments●
Using Variables in Loops●
Exampl...
... by 2.7 is not really 1 .44 444 444 ,
but rather something more like 1 .44 444 444 444 444 44. But even that answer isn't completely accurate. A
more accurate answer would be 1 .44 444 444 444 444 444 444 444 444 444 444 . ... accurate answer would be 1 .44 444 444 444 444 444 444 444 444 444 444 . The more 4s you add to the
answer the more accurate the answer becomes-yet, because the 4...
... that was pressed.
Force Java to redraw the applet.
Tell Java that the event was handled.
Handling Events Directly
All of the events received by your applet are processed by the handleEvent() method, ... frame window. Figure 24. 1 shows the applet, the frame
window, and the dialog box.
Figure 24. 1 : This is DialogApplet running under Appletviewer.
Listing 24. 1 DialogApplet .java: An...