Java Reference
In-Depth Information
LISTING 11.14
continued
DISPLAY
The
ListPanel
class shown in Listing 11.15 defines the panel that contains the
list of file names. We use a
list
component, defined by the
JList
class, to display
the list of file names. The list contents are set up as an array of
String
objects,
which are passed into the
JList
constructor.
LISTING 11.15
//********************************************************************
// ListPanel.java Author: Lewis/Loftus
//
// Represents the list of images for the PickImage program.
//********************************************************************
import
java.awt.*;
import
javax.swing.*;
import
javax.swing.event.*;
public class
ListPanel
extends
JPanel
{
private
JLabel label;
Search WWH ::
Custom Search