Previous Slide


THE "Pen" INTERFACE

Next Slide

NAMES LIKE "clearRect" and "fillRect" ENABLE YOUR APPLET TO TELL THE BROWSER WHAT TO DO.

  • THESE ARE ALSO "METHOD" NAMES. THE METHODS ARE PROVIDED BY THE BROWSER SO THEY ARE NOT DESCRIBED IN YOUR JAVA CODE.

  • THE METHODS THAT CAN BE USED ARE PRESPECIFIED.
    clearRect,fillRect,drawString,clearString,drawLine,...

  • THE PARAMETERS THAT MAY OR MUST BE INCLUDED ARE ALSO FIXED.
    "clearRect" EXPECTS EITHER A SET OF FOUR COORDINATES SPECIFYING THE BOUNDARY OF A RECTANGLE OR NOTHING.



The Web:
Technologies and
Techniques


Links to other course pages:


Williams College
Department of Computer Science
This page is part of a section of lecture slides related to " Basics of Java Graphics " within the topic "Java -- Executable Web Content". Other slides within this section and other sections of slides for the topic "Java -- Executable Web Content" can be accessed using the links below.
  • Limitations of the Client/Server Model
  • THE CLIENT/SERVER MODEL LIMITS THE WEB
  • FORMS PROVIDE LIMITED INTERACTIVITY
  • How Applets Fit
  • ACTIVE DOCUMENTS
  • JAVA
  • Applet Structure
  • APPLET STRUCTURE
  • METHOD STRUCTURE
  • METHOD PARAMETERS
  • Event Handling
  • THE "EVENT" INTERFACE
  • Basics of Java Graphics
  • IDENTIFYING PIXELS
  • THE "Pen" INTERFACE
  • GRAPHIC PRIMITIVES
  • DRAWING TEXT
  • OPTIONAL PARAMETERS
  • LINE DRAWING
  • Shape Drawing Methods
  • SHAPE DRAWING
  • SHAPE DRAWING (cont.)
  • CLEAR METHODS
  • DRAWING + CLEARING = INVERSION
  • Specifying Colors
  • User Interface Components
  • User Interface Components
  • Component Constructors
  • The Slider Constructor Method
  • The Slider Constructor Method (cont.)
  • Variables
  • Naming Components
  • Instance Variable Names
  • Associating Names with Components
  • Component Layout Management
  • Adding Components to the Display
  • The Layout Manager
  • Event Handlers for Components
  • Component Event Handlers
  • THE scroll METHOD
  • COMPONENT ACCESS METHODS
  • THE SLIDER getValue METHOD
  • More on Methods
  • PUBLIC VS. PRIVATE
  • PRIVATE METHODS
  • VOID vs. NON-VOID METHODS
  • FUNCTIONS