The Java Tutorial: Object-oriented Programming for the Internet"The Java Tutorial, 2nd Ed". is a practical, step-by-step guide to writing programs with JDK 1.1. The second edition begins with the basics of the language and progresses through more advanced topics such as thread programing, applet programming, and designing and implementing graphical user interfaces. The material is presented as a self-guided tutorial and literally comes alive when you run the examples from the book on the Web and CD-ROM. |
From inside the book
Results 1-3 of 44
Page 23
... Graphics ; public class HelloWorld extends Applet { public void paint ( Graphics g ) { } g.drawString ( " Hello world ! " , 50 , 25 ) ; } If you removed the first two lines , you could still compile and run the program , but only if you ...
... Graphics ; public class HelloWorld extends Applet { public void paint ( Graphics g ) { } g.drawString ( " Hello world ! " , 50 , 25 ) ; } If you removed the first two lines , you could still compile and run the program , but only if you ...
Page 419
... paint method does nothing . The Graphics Object The only argument to the paint and update methods is a Graphics ... g ) { } Dimension d = getSize ( ) ; g.drawRect ( 0,0 , d.width - 1 , d.height - 1 ) ; Programs that repaint themselves ...
... paint method does nothing . The Graphics Object The only argument to the paint and update methods is a Graphics ... g ) { } Dimension d = getSize ( ) ; g.drawRect ( 0,0 , d.width - 1 , d.height - 1 ) ; Programs that repaint themselves ...
Page 529
... drawing/drawingShapes.html You can find the complete program on page 861. Here is just the drawing code : // In FramedArea ( a Panel subclass ) : public void paint ( Graphics g ) { Dimension d = getSize ( ) ; Color bg = getBackground ...
... drawing/drawingShapes.html You can find the complete program on page 861. Here is just the drawing code : // In FramedArea ( a Panel subclass ) : public void paint ( Graphics g ) { Dimension d = getSize ( ) ; Color bg = getBackground ...
Contents
The Hello World Application | 9 |
The Hello World Applet | 19 |
Compiler Problems | 28 |
Copyright | |
32 other sections not shown
Common terms and phrases
1.0 SOURCE CODE animation application args array boolean browser BufferedReader button byte call stack called catch IOException Checkbox checksum cksum clicks client compiler component constructor create declaration default defines deprecated display double buffering error event example exception extends Applet filename GridBagConstraints GridBagLayout Hello World Here's implements import java.applet.Applet import java.awt import java.io initialization inner class input instance variables interface Java language Java platform Java program Java Virtual Machine java.lang Label layout manager lesson listener loaded loop main method member variable menu mouse MouseEvent newline null object object-oriented Object-Oriented Programming operator override package PAGES CONTAINING APPLET Panel parameter PrintWriter provides public class public static void public void public void init Rectangle Scrollbar server socket specify statement static void main(String String StringBuffer subclass system properties TextArea TextField thread ThreadGroup throws IOException window WindowEvent write