September 2005
Beginner
576 pages
13h 6m
English
As you may recall, one of the main advantages of object-oriented programming is the capability to reuse classes in different projects. For this hour's workshop, you will create a special panel component that can be reused in different Java programs. The component, ClockPanel, displays the current date and time in a manner similar to the ClockTalk project from Hour 7, “Using Conditional Tests to Make Decisions.”
The first step in creating your own user interface component is to decide the existing component from which to inherit. The ClockPanel component is most like a panel, so it will be a subclass of JPanel.
The ClockPanel class is defined in Listing 13.3. This class represents panel components that include ...
Read now
Unlock full access