KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > mc4j > console > swing > editor > jmx > ObjectNameSelector


1 /*
2  * Copyright 2002-2004 Greg Hinkle
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16
17 package org.mc4j.console.swing.editor.jmx;
18
19 import javax.swing.ListModel JavaDoc;
20 import javax.swing.ListSelectionModel JavaDoc;
21
22 /**
23  *
24  * @author Greg Hinkle (ghinkle@users.sourceforge.net), January 2002
25  * @version $Revision: 480 $($Author: ghinkl $ / $Date: 2004-10-05 01:17:41 -0400 (Tue, 05 Oct 2004) $)
26  */

27 public class ObjectNameSelector extends javax.swing.JPanel JavaDoc {
28     
29     /** Creates new form ObjectNameSelector */
30     public ObjectNameSelector(ListModel JavaDoc listModel, ListSelectionModel JavaDoc selectionModel) {
31         initComponents();
32         this.objectNameList.setModel(listModel);
33         this.objectNameList.setSelectionModel(selectionModel);
34     }
35     
36     /** This method is called from within the constructor to
37      * initialize the form.
38      * WARNING: Do NOT modify this code. The content of this method is
39      * always regenerated by the Form Editor.
40      */

41     private void initComponents() {//GEN-BEGIN:initComponents
42
java.awt.GridBagConstraints JavaDoc gridBagConstraints;
43
44         introTextLabel = new javax.swing.JLabel JavaDoc();
45         objectNameListScrollPane = new javax.swing.JScrollPane JavaDoc();
46         objectNameList = new javax.swing.JList JavaDoc();
47
48         setLayout(new java.awt.GridBagLayout JavaDoc());
49
50         setMinimumSize(new java.awt.Dimension JavaDoc(500, 520));
51         setNextFocusableComponent(objectNameList);
52         setPreferredSize(new java.awt.Dimension JavaDoc(500, 540));
53         introTextLabel.setFont(new java.awt.Font JavaDoc("Dialog", 0, 12));
54         introTextLabel.setText("Choose an ObjectName:");
55         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
56         gridBagConstraints.insets = new java.awt.Insets JavaDoc(4, 8, 4, 8);
57         gridBagConstraints.anchor = java.awt.GridBagConstraints.SOUTHWEST;
58         add(introTextLabel, gridBagConstraints);
59
60         objectNameListScrollPane.setMinimumSize(null);
61         //objectNameListScrollPane.setPreferredSize(new java.awt.Dimension(400, 131));
62
objectNameList.setMaximumSize(null);
63         objectNameList.setMinimumSize(null);
64         objectNameList.setPreferredSize(null);
65         objectNameListScrollPane.setViewportView(objectNameList);
66
67         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
68         gridBagConstraints.gridx = 0;
69         gridBagConstraints.gridy = 1;
70         gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
71         gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
72         gridBagConstraints.insets = new java.awt.Insets JavaDoc(4, 8, 8, 8);
73         gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
74         gridBagConstraints.weighty = 1.0;
75         add(objectNameListScrollPane, gridBagConstraints);
76
77     }//GEN-END:initComponents
78

79     
80     // Variables declaration - do not modify//GEN-BEGIN:variables
81
private javax.swing.JScrollPane JavaDoc objectNameListScrollPane;
82     private javax.swing.JList JavaDoc objectNameList;
83     private javax.swing.JLabel JavaDoc introTextLabel;
84     // End of variables declaration//GEN-END:variables
85

86 }
87
Popular Tags