aboutsummaryrefslogtreecommitdiffstats
path: root/java
diff options
context:
space:
mode:
authorBrian P. Hinz <bphinz@users.sf.net>2020-09-04 19:09:48 -0400
committerBrian P. Hinz <bphinz@users.sf.net>2020-09-04 19:11:35 -0400
commite8fc72b43ceb1a68b6e5e3b9139c6533d3535be6 (patch)
tree08e5b81a99a4ff1f9fbc81cb4139d61a5f310090 /java
parentac76a87b7feaf2bab0e5db693ef68004f5e3b545 (diff)
downloadtigervnc-e8fc72b43ceb1a68b6e5e3b9139c6533d3535be6.tar.gz
tigervnc-e8fc72b43ceb1a68b6e5e3b9139c6533d3535be6.zip
[java] don't show password field for secTypes that don't use it
Diffstat (limited to 'java')
-rw-r--r--java/com/tigervnc/vncviewer/UserDialog.java19
1 files changed, 11 insertions, 8 deletions
diff --git a/java/com/tigervnc/vncviewer/UserDialog.java b/java/com/tigervnc/vncviewer/UserDialog.java
index 9804aafa..d35be48d 100644
--- a/java/com/tigervnc/vncviewer/UserDialog.java
+++ b/java/com/tigervnc/vncviewer/UserDialog.java
@@ -129,14 +129,16 @@ public class UserDialog implements UserPasswdGetter, UserMsgBox
y += 25 + 5;
}
- JLabel passwdLabel = new JLabel("Password:");
- passwdLabel.setBounds(70, y, msg.getSize().width-70-10, 20);
- msg.add(passwdLabel);
- y += 20 + 5;
final JPasswordField passwd = new JPasswordField(30);
- passwd.setBounds(70, y, msg.getSize().width-70-10, 25);
- msg.add(passwd);
- y += 25 + 5;
+ if (password != null) {
+ JLabel passwdLabel = new JLabel("Password:");
+ passwdLabel.setBounds(70, y, msg.getSize().width-70-10, 20);
+ msg.add(passwdLabel);
+ y += 20 + 5;
+ passwd.setBounds(70, y, msg.getSize().width-70-10, 25);
+ msg.add(passwd);
+ y += 25 + 5;
+ }
msg.setPreferredSize(new Dimension(410, y));
@@ -149,7 +151,8 @@ public class UserDialog implements UserPasswdGetter, UserMsgBox
options[0]){//default button title
@Override
public void selectInitialValue() {
- passwd.requestFocusInWindow();
+ if (password != null)
+ passwd.requestFocusInWindow();
}
};
pane.setBorder(new EmptyBorder(0,0,0,0));