Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

show/hide password functionality

  • Loading branch information...
commit 03f739462fe26f9eca8d3f55d6e3d5a8dff712d7 1 parent 07d632b
@jkallunki authored
Showing with 14 additions and 0 deletions.
  1. +14 −0 Swirc/src/swirc/ConnectDialog.java
View
14 Swirc/src/swirc/ConnectDialog.java
@@ -4,6 +4,8 @@
import java.awt.Container;
import java.awt.FlowLayout;
import java.awt.GridLayout;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
import javax.swing.*;
/**
@@ -56,8 +58,20 @@ public ConnectDialog(JFrame parent, SwircModel model) {
inputPane.add(new JLabel("Password"));
serverPsw = new JPasswordField(20);
+ serverPsw.setEchoChar('*');
inputPane.add(serverPsw);
showPsw = new JCheckBox("Show password");
+ showPsw.addActionListener(new ActionListener() {
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ if(!showPsw.isSelected()) {
+ serverPsw.setEchoChar('*');
+ }
+ else {
+ serverPsw.setEchoChar((char)0);
+ }
+ }
+ });
inputPane.add(showPsw);
//TODO remember to remove nick from this dialog
Please sign in to comment.
Something went wrong with that request. Please try again.