desktop/desktop-sample/src/main/java/cz/xelfi/quoridor/desktop/sample/LoginPanel.java
2 * To change this template, choose Tools | Templates
3 * and open the template in the editor.
6 package cz.xelfi.quoridor.desktop.sample;
10 * @author Jaroslav Tulach
12 class LoginPanel extends javax.swing.JPanel {
14 /** Creates new form LoginPanel */
19 /** This method is called from within the constructor to
20 * initialize the form.
21 * WARNING: Do NOT modify this code. The content of this method is
22 * always regenerated by the Form Editor.
24 @SuppressWarnings("unchecked")
25 // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
26 private void initComponents() {
28 loginLabel = new javax.swing.JLabel();
29 login = new javax.swing.JTextField();
30 passwordLabel = new javax.swing.JLabel();
31 password = new javax.swing.JPasswordField();
33 loginLabel.setText(org.openide.util.NbBundle.getMessage(LoginPanel.class, "LoginPanel.loginLabel.text")); // NOI18N
35 login.setText(org.openide.util.NbBundle.getMessage(LoginPanel.class, "LoginPanel.login.text")); // NOI18N
37 passwordLabel.setText(org.openide.util.NbBundle.getMessage(LoginPanel.class, "LoginPanel.passwordLabel.text")); // NOI18N
39 password.setText(org.openide.util.NbBundle.getMessage(LoginPanel.class, "LoginPanel.password.text")); // NOI18N
41 javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
42 this.setLayout(layout);
43 layout.setHorizontalGroup(
44 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
45 .addGroup(layout.createSequentialGroup()
47 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
48 .addComponent(loginLabel)
49 .addComponent(passwordLabel))
50 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
51 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
52 .addComponent(password, javax.swing.GroupLayout.DEFAULT_SIZE, 289, Short.MAX_VALUE)
53 .addComponent(login, javax.swing.GroupLayout.DEFAULT_SIZE, 289, Short.MAX_VALUE))
56 layout.setVerticalGroup(
57 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
58 .addGroup(layout.createSequentialGroup()
60 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
61 .addComponent(loginLabel)
62 .addComponent(login, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
63 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
64 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
65 .addComponent(passwordLabel)
66 .addComponent(password, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
67 .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
69 }// </editor-fold>//GEN-END:initComponents
72 // Variables declaration - do not modify//GEN-BEGIN:variables
73 private javax.swing.JTextField login;
74 private javax.swing.JLabel loginLabel;
75 private javax.swing.JPasswordField password;
76 private javax.swing.JLabel passwordLabel;
77 // End of variables declaration//GEN-END:variables
79 public String getLogin() {
80 return login.getText();
83 public String getPassword() {
84 return new String(password.getPassword());