June 2005
Beginner to intermediate
336 pages
6h 29m
English
The first thing to do in Intercom 1 is to create the window and controls you see in Figure 9.1. This works by creating a new object of the Intercom1 class in the main method:
import java.awt.*;
import java.awt.event.*;
public class Intercom1 extends Frame implements Runnable, ActionListener
{
public static void main(String[] args)
{
new Intercom1();
}
.
.
.
}
Next, the code adds the Send button, connects it to an ActionListener, and adds the top text area control (note that the text area controls in this project have only vertical scrollbars so that the user doesn't have to stop to scroll horizontally with the mouse each time long text appears or he's typing something longer than the text area can display on one line):
Read now
Unlock full access