home *** CD-ROM | disk | FTP | other *** search
Java Source | 1996-08-14 | 809 b | 37 lines |
- // LabList.java - A labelled listbox
- //
- // Copyright (C) 1996 by Dale Gass
- // Non-exclusive license granted to MKS, Inc.
- //
-
- import java.lang.*;
- import java.util.*;
- import java.awt.*;
- import java.net.*;
- import java.applet.*;
-
- // LabList = a labelled listbox
-
- public class LabList extends Panel {
- public Label label;
- public List list;
-
- LabList(String title, int rows, boolean multi) {
- setLayout(new BorderLayout());
- add("North", label = new Label(title, Label.LEFT));
- add("Center", list = new List(rows, multi));
- }
-
- public void addItems(String items[]) {
- for (int i=0; i<items.length; i++)
- list.addItem(items[i]);
- }
-
- public void selectAll() {
- int n = list.countItems();
- for (int i=0; i<n; i++)
- list.select(i);
- }
- }
-
-