desktop/desktop-sample/src/main/java/cz/xelfi/quoridor/desktop/sample/LoginPanel.java
2 * Quoridor server and related libraries
3 * Copyright (C) 2009-2010 Jaroslav Tulach <jaroslav.tulach@apidesign.org>
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program. Look for COPYING file in the top folder.
16 * If not, see http://www.gnu.org/licenses/.
19 package cz.xelfi.quoridor.desktop.sample;
23 * @author Jaroslav Tulach
25 class LoginPanel extends javax.swing.JPanel {
27 /** Creates new form LoginPanel */
32 /** This method is called from within the constructor to
33 * initialize the form.
34 * WARNING: Do NOT modify this code. The content of this method is
35 * always regenerated by the Form Editor.
37 @SuppressWarnings("unchecked")
38 // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
39 private void initComponents() {
41 loginLabel = new javax.swing.JLabel();
42 login = new javax.swing.JTextField();
43 passwordLabel = new javax.swing.JLabel();
44 password = new javax.swing.JPasswordField();
46 loginLabel.setText(org.openide.util.NbBundle.getMessage(LoginPanel.class, "LoginPanel.loginLabel.text")); // NOI18N
48 login.setText(org.openide.util.NbBundle.getMessage(LoginPanel.class, "LoginPanel.login.text")); // NOI18N
50 passwordLabel.setText(org.openide.util.NbBundle.getMessage(LoginPanel.class, "LoginPanel.passwordLabel.text")); // NOI18N
52 password.setText(org.openide.util.NbBundle.getMessage(LoginPanel.class, "LoginPanel.password.text")); // NOI18N
54 javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
55 this.setLayout(layout);
56 layout.setHorizontalGroup(
57 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
58 .addGroup(layout.createSequentialGroup()
60 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
61 .addComponent(loginLabel)
62 .addComponent(passwordLabel))
63 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
64 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
65 .addComponent(password, javax.swing.GroupLayout.DEFAULT_SIZE, 289, Short.MAX_VALUE)
66 .addComponent(login, javax.swing.GroupLayout.DEFAULT_SIZE, 289, Short.MAX_VALUE))
69 layout.setVerticalGroup(
70 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
71 .addGroup(layout.createSequentialGroup()
73 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
74 .addComponent(loginLabel)
75 .addComponent(login, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
76 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
77 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
78 .addComponent(passwordLabel)
79 .addComponent(password, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
80 .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
82 }// </editor-fold>//GEN-END:initComponents
85 // Variables declaration - do not modify//GEN-BEGIN:variables
86 private javax.swing.JTextField login;
87 private javax.swing.JLabel loginLabel;
88 private javax.swing.JPasswordField password;
89 private javax.swing.JLabel passwordLabel;
90 // End of variables declaration//GEN-END:variables
92 public String getLogin() {
93 return login.getText();
96 public String getPassword() {
97 return new String(password.getPassword());