KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jdesktop > swing > JXListPanel


1 /*
2  * $Id: JXListPanel.java,v 1.1 2004/07/28 21:21:11 aim Exp $
3  *
4  * Copyright 2004 Sun Microsystems, Inc., 4150 Network Circle,
5  * Santa Clara, California 95054, U.S.A. All rights reserved.
6  */

7
8 package org.jdesktop.swing;
9
10 import java.awt.*;
11
12 import javax.swing.*;
13
14 /**
15  * A form control to represents arrays or list of items.
16  * This will be adapted into some sort of list editor.
17  */

18 public class JXListPanel extends JPanel {
19
20     private static Dimension PREFSIZE = new Dimension(200, 34);
21     private JList list;
22
23     public JXListPanel() {
24     setLayout(new BorderLayout());
25
26     list = new JList();
27     list.setPrototypeCellValue("MondayXXXXXXXXXXX");
28
29     add(new JScrollPane(list));
30     }
31
32     public JList getList() {
33     return list;
34     }
35
36     public Dimension getPreferredSize() {
37     return PREFSIZE;
38     }
39
40     public Dimension getMaximiumSize() {
41     return getPreferredSize();
42     }
43
44 }
45
Popular Tags