KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > ozoneDB > adminGui > feature > account > groups > WorkGroupPanel


1 // You can redistribute this software and/or modify it under the terms of
2
// the Ozone Library License version 1 published by ozone-db.org.
3
//
4
// The original code and portions created by SMB are
5
// Copyright (C) 1997-@year@ by SMB GmbH. All rights reserved.
6
//
7
package org.ozoneDB.adminGui.feature.account.groups;
8
9 import java.awt.GridBagConstraints JavaDoc;
10 import java.awt.GridBagLayout JavaDoc;
11 import java.awt.Insets JavaDoc;
12 import javax.swing.JLabel JavaDoc;
13 import javax.swing.JPanel JavaDoc;
14 import javax.swing.JTextField JavaDoc;
15
16
17 //#############################################################################
18
/**
19  * This class creates the input panel that queries for the group string.
20  *
21  * @author <p align=center>Ibsen Ramos-Bonilla
22  * <br>Copyright &copy 1997-@year@ by SMB GmbH. All Rights Reserved.</p>
23  *
24  * @version 1.0
25  */

26 //#############################################################################
27

28 public class WorkGroupPanel extends JPanel JavaDoc {
29
30     /** The text field used to enter the group name. */
31     private JTextField JavaDoc groupText = new JTextField JavaDoc();
32
33
34     /**
35      * Default constructor.
36      */

37     public WorkGroupPanel() {
38         this(null);
39     }
40
41     /**
42      * Overloaded constructor.
43      *
44      * @param groupName - the group being worked on.
45      */

46     public WorkGroupPanel(String JavaDoc groupName) {
47         super();
48         init(groupName);
49     }
50
51     /**
52      * This method initializes the input panel which gets the group information.
53      *
54      * @param groupName - the group being worked on.
55      */

56     private void init(String JavaDoc groupName) {
57         this.setLayout(new GridBagLayout JavaDoc());
58
59         //add group section
60
this.add(new JLabel JavaDoc("Group Name:"),
61                 new GridBagConstraints JavaDoc(0, 0, 1, 1, 0.0, 0.0,
62                         GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL,
63                         new Insets JavaDoc(10, 10, 0, 10), 0, 0));
64         this.add(groupText,
65                 new GridBagConstraints JavaDoc(1, 0, 1, 1, 0.0, 0.0,
66                         GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL,
67                         new Insets JavaDoc(10, 10, 0, 10), 265, 0));
68
69         //enable/disable the group text box
70
if (groupName != null) {
71             groupText.setText(groupName);
72             groupText.setEnabled(false);
73         }
74     }
75
76     /**
77      * This method returns the group name.
78      *
79      * @return String - group name.
80      */

81     public String JavaDoc getGroup() {
82         return groupText.getText();
83     }
84
85 } //--------------------------------- E O F -----------------------------------
86
Popular Tags