Mercurial > hg > ltpda-connection-manager
annotate ConnectionManager/src/connectionmanager/CredentialsDialog.java @ 5:35f1cfcaa5a9
Add crude Java GUI.
author | Daniele Nicolodi <daniele@science.unitn.it> |
---|---|
date | Wed, 02 Jun 2010 17:29:18 +0200 |
parents | |
children | 670905eb688a |
rev | line source |
---|---|
5
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
1 package connectionmanager; |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
2 |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
3 public class CredentialsDialog extends javax.swing.JDialog { |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
4 |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
5 private String[] usernames; |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
6 private String[] passwords; |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
7 |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
8 public boolean cancelled = true; |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
9 public boolean cache = false; |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
10 public String username = null; |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
11 public String password = null; |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
12 |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
13 public CredentialsDialog(java.awt.Frame parent, boolean modal) { |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
14 super(parent, modal); |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
15 initComponents(); |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
16 } |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
17 |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
18 public CredentialsDialog() { |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
19 super(new javax.swing.JFrame(), true); |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
20 initComponents(); |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
21 } |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
22 |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
23 public CredentialsDialog(String[] usernames, String[] passwords) { |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
24 super(new javax.swing.JFrame(), true); |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
25 this.usernames = usernames; |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
26 this.passwords = passwords; |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
27 initComponents(); |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
28 |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
29 if (usernames != null) { |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
30 this.usernameField.setModel(new javax.swing.DefaultComboBoxModel(usernames)); |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
31 } |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
32 } |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
33 |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
34 @SuppressWarnings("unchecked") |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
35 // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
36 private void initComponents() { |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
37 |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
38 okButton = new javax.swing.JButton(); |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
39 cancelButton = new javax.swing.JButton(); |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
40 jLabel3 = new javax.swing.JLabel(); |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
41 passwordField = new javax.swing.JPasswordField(); |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
42 cacheCheckBox = new javax.swing.JCheckBox(); |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
43 usernameField = new javax.swing.JComboBox(); |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
44 jLabel2 = new javax.swing.JLabel(); |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
45 jLabel1 = new javax.swing.JLabel(); |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
46 |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
47 addWindowListener(new java.awt.event.WindowAdapter() { |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
48 public void windowClosing(java.awt.event.WindowEvent evt) { |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
49 closeDialog(evt); |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
50 } |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
51 }); |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
52 |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
53 okButton.setText("Connect"); |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
54 okButton.setSelected(true); |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
55 okButton.addActionListener(new java.awt.event.ActionListener() { |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
56 public void actionPerformed(java.awt.event.ActionEvent evt) { |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
57 okButtonActionPerformed(evt); |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
58 } |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
59 }); |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
60 |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
61 cancelButton.setText("Cancel"); |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
62 cancelButton.addActionListener(new java.awt.event.ActionListener() { |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
63 public void actionPerformed(java.awt.event.ActionEvent evt) { |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
64 cancelButtonActionPerformed(evt); |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
65 } |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
66 }); |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
67 |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
68 jLabel3.setText("Credentials for mysql://%s/%s/"); |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
69 |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
70 cacheCheckBox.setText("Remember this password"); |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
71 |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
72 usernameField.setEditable(true); |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
73 usernameField.addActionListener(new java.awt.event.ActionListener() { |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
74 public void actionPerformed(java.awt.event.ActionEvent evt) { |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
75 usernameFieldActionPerformed(evt); |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
76 } |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
77 }); |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
78 |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
79 jLabel2.setText("Password:"); |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
80 |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
81 jLabel1.setText("Username:"); |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
82 |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
83 org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane()); |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
84 getContentPane().setLayout(layout); |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
85 layout.setHorizontalGroup( |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
86 layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
87 .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup() |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
88 .addContainerGap(251, Short.MAX_VALUE) |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
89 .add(cancelButton) |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
90 .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED) |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
91 .add(okButton) |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
92 .addContainerGap()) |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
93 .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
94 .add(layout.createSequentialGroup() |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
95 .add(36, 36, 36) |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
96 .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
97 .add(cacheCheckBox, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 351, Short.MAX_VALUE) |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
98 .add(layout.createSequentialGroup() |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
99 .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
100 .add(jLabel1) |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
101 .add(jLabel2)) |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
102 .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED) |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
103 .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
104 .add(passwordField, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 271, Short.MAX_VALUE) |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
105 .add(usernameField, 0, 271, Short.MAX_VALUE))) |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
106 .add(jLabel3)) |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
107 .add(36, 36, 36))) |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
108 ); |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
109 layout.setVerticalGroup( |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
110 layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
111 .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup() |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
112 .addContainerGap(266, Short.MAX_VALUE) |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
113 .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
114 .add(okButton) |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
115 .add(cancelButton)) |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
116 .addContainerGap()) |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
117 .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
118 .add(layout.createSequentialGroup() |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
119 .add(81, 81, 81) |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
120 .add(jLabel3) |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
121 .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
122 .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
123 .add(jLabel1) |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
124 .add(usernameField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 21, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
125 .add(14, 14, 14) |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
126 .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
127 .add(passwordField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
128 .add(jLabel2)) |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
129 .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED) |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
130 .add(cacheCheckBox) |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
131 .add(116, 116, 116))) |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
132 ); |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
133 |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
134 pack(); |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
135 }// </editor-fold>//GEN-END:initComponents |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
136 |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
137 private void okButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_okButtonActionPerformed |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
138 cancelled = false; |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
139 username = (String)usernameField.getSelectedItem(); |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
140 password = new String(passwordField.getPassword()); |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
141 cache = cacheCheckBox.isSelected(); |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
142 doClose(); |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
143 }//GEN-LAST:event_okButtonActionPerformed |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
144 |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
145 private void cancelButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cancelButtonActionPerformed |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
146 cancelled = true; |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
147 doClose(); |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
148 }//GEN-LAST:event_cancelButtonActionPerformed |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
149 |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
150 private void closeDialog(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_closeDialog |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
151 cancelled = true; |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
152 doClose(); |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
153 }//GEN-LAST:event_closeDialog |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
154 |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
155 private void usernameFieldActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_usernameFieldActionPerformed |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
156 |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
157 }//GEN-LAST:event_usernameFieldActionPerformed |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
158 |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
159 private void doClose() { |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
160 setVisible(false); |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
161 dispose(); |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
162 } |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
163 |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
164 // Variables declaration - do not modify//GEN-BEGIN:variables |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
165 private javax.swing.JCheckBox cacheCheckBox; |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
166 private javax.swing.JButton cancelButton; |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
167 private javax.swing.JLabel jLabel1; |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
168 private javax.swing.JLabel jLabel2; |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
169 private javax.swing.JLabel jLabel3; |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
170 private javax.swing.JButton okButton; |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
171 private javax.swing.JPasswordField passwordField; |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
172 private javax.swing.JComboBox usernameField; |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
173 // End of variables declaration//GEN-END:variables |
35f1cfcaa5a9
Add crude Java GUI.
Daniele Nicolodi <daniele@science.unitn.it>
parents:
diff
changeset
|
174 } |