June 2005
Beginner to intermediate
336 pages
6h 29m
English
The Forecaster project can also be written as a standalone desktop Java application, Forecast.java. To display the weather graph, as you see in Figure 10.2, you can create the Forecast class by extending the Frame class:
import java.io.*;
import java.awt.*;
import java.net.*;
import java.awt.image.*;
import java.awt.event.*;
public class Forecast extends Frame
.
.
.
This application will also need a way of asking the user his ZIP Code, so it'll use the OKCancelDialog class introduced in Chapter 2, “Slapshot! The Interactive Hockey Game”:
import java.io.*;
import java.awt.*;
import java.net.*;
import java.awt.image.*;
import java.awt.event.*;
public class Forecast extends Frame
{
OkCancelDialog textDialog; . . . ...Read now
Unlock full access