KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > ozoneDB > adminGui > feature > account > users > WorkUserPanel


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.users;
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 account and password
20  * strings.
21  *
22  * @author <p align=center>Ibsen Ramos-Bonilla
23  * <br>Copyright &copy 1997-@year@ by SMB GmbH. All Rights Reserved.</p>
24  *
25  * @version 1.0
26  */

27 //#############################################################################
28

29 public class WorkUserPanel extends JPanel JavaDoc {
30
31     /** The text field used to enter the account name. */
32     private JTextField JavaDoc userNameText = new JTextField JavaDoc();
33     /** The text field used to enter the account password. */
34     private JTextField JavaDoc userPasswordText = new JTextField JavaDoc();
35
36
37     /**
38      * Default constructor.
39      */

40     public WorkUserPanel() {
41         super();
42         init();
43     }
44
45     /**
46      * This method initializes the input panel which gets the account information.
47      */

48     private void init() {
49         this.setLayout(new GridBagLayout JavaDoc());
50
51         //add account name section
52
this.add(new JLabel JavaDoc("User Name:"),
53                 new GridBagConstraints JavaDoc(0, 0, 1, 1, 0.0, 0.0,
54                         GridBagConstraints.WEST, GridBagConstraints.NONE,
55                         new Insets JavaDoc(10, 10, 0, 10), 0, 0));
56         this.add(userNameText,
57                 new GridBagConstraints JavaDoc(1, 0, 1, 1, 0.0, 0.0,
58                         GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL,
59                         new Insets JavaDoc(10, 10, 0, 10), 150, 0));
60
61         //add account password section
62
this.add(new JLabel JavaDoc("User Password:"),
63                 new GridBagConstraints JavaDoc(0, 1, 1, 1, 0.0, 0.0,
64                         GridBagConstraints.WEST, GridBagConstraints.NONE,
65                         new Insets JavaDoc(10, 10, 0, 10), 0, 0));
66         this.add(userPasswordText,
67                 new GridBagConstraints JavaDoc(1, 1, 1, 1, 0.0, 0.0,
68                         GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL,
69                         new Insets JavaDoc(10, 10, 0, 10), 150, 0));
70     }
71
72     /**
73      * This method returns the account name.
74      *
75      * @return String - account name.
76      */

77     public String JavaDoc getUserName() {
78         return userNameText.getText();
79     }
80
81     /**
82      * This method returns the account password.
83      *
84      * @return String - account password.
85      */

86     public String JavaDoc getUserPassword() {
87         return userPasswordText.getText();
88     }
89
90 } //--------------------------------- E O F -----------------------------------
91
Popular Tags