Tabnine Logo
JPasswordField.addActionListener
Code IndexAdd Tabnine to your IDE (free)

How to use
addActionListener
method
in
javax.swing.JPasswordField

Best Java code snippets using javax.swing.JPasswordField.addActionListener (Showing top 20 results out of 315)

origin: nodebox/nodebox

@Override
protected JTextComponent createField() {
  JPasswordField field = new JPasswordField();
  field.putClientProperty("JComponent.sizeVariant", "small");
  field.setFont(Theme.SMALL_BOLD_FONT);
  field.addActionListener(this);
  field.addFocusListener(new FocusAdapter() {
    public void focusLost(FocusEvent e) {
      commitTextFieldValue();
    }
  });
  return field;
}
origin: magefree/mage

txtPasswordField.addActionListener(evt -> txtPasswordFieldActionPerformed(evt));
origin: magefree/mage

/**
 * Creates new form ConnectDialog
 */
public ConnectDialog() {
  initComponents();
  this.txtServer.addActionListener(connectAction);
  this.txtPort.addActionListener(connectAction);
  this.txtUserName.addActionListener(connectAction);
  this.txtPassword.addActionListener(connectAction);
  registerUserDialog = new RegisterUserDialog(this);
  MageFrame.getDesktop().add(registerUserDialog, JLayeredPane.MODAL_LAYER);
  resetPasswordDialog = new ResetPasswordDialog(this);
  MageFrame.getDesktop().add(resetPasswordDialog, JLayeredPane.MODAL_LAYER);
}
origin: org.zaproxy/zap

private JPasswordField getTxtProxyChainPassword() {
  if (txtProxyChainPassword == null) {
    txtProxyChainPassword = new JPasswordField();
    txtProxyChainPassword.addActionListener(new java.awt.event.ActionListener() { 
      @Override
      public void actionPerformed(java.awt.event.ActionEvent e) {
        proxyDialog.saveAndClose();
      }
    });
  }
  return txtProxyChainPassword;
}
 
origin: magefree/mage

txtPasswordField.addActionListener(new java.awt.event.ActionListener() {
  public void actionPerformed(java.awt.event.ActionEvent evt) {
    txtPasswordFieldActionPerformed(evt);
origin: stackoverflow.com

public static void main(String args[]) {
     JFrame box = new JFrame("Password");
     box.setVisible(true);
     box.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
     box.setSize(400,100);
   JPasswordField pass = new JPasswordField(10);
     //add action listener 
     pass.addActionListener(new AL());
     //add the pass to the box 
     box.add(pass); ;  
   }
origin: org.apache.jmeter/ApacheJMeter_core

protected PasswordEditor() {
  super();
  textField = new JPasswordField();
  textField.addActionListener(this);
  textField.addFocusListener(this);
}
origin: org.zaproxy/zap

public void addFieldListener(String fieldLabel, ActionListener listener) {
  Component c = this.fieldMap.get(fieldLabel);
  if (c != null) {
    if (c instanceof ZapTextField) {
      ((ZapTextField)c).addActionListener(listener);
    } else if (c instanceof JPasswordField) {
      ((JPasswordField)c).addActionListener(listener);
    } else if (c instanceof JComboBox) {
      ((JComboBox<?>)c).addActionListener(listener);
    } else if (c instanceof JCheckBox) {
      ((JCheckBox)c).addActionListener(listener);
    } else {
      logger.error("Unrecognised field class " + fieldLabel + ": " + c.getClass().getCanonicalName());
    }
  }
}
origin: stackoverflow.com

passWord.addActionListener(new AL());
getContentPane().add(passWord);
origin: stackoverflow.com

Passwordfld.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
origin: com.darwinsys/darwinsys-api

/**
 * Prompt for a password, and wait until the user enters it.
 * @param prompt The prompt string
 * @return The new password.
 */
@SuppressWarnings("serial")
private String getPassword(String prompt) {
  final JDialog input = new JDialog(mainWindow, "Prompt", true);
  input.setLayout(new FlowLayout());
  input.add(new JLabel(prompt));
  JPasswordField textField = new JPasswordField(10);
  input.add(textField);
  Action okAction = new AbstractAction("OK") {
    public void actionPerformed(ActionEvent e) {
      input.dispose();
    }
  };
  textField.addActionListener(okAction);
  JButton ok = new JButton(okAction);
  input.add(ok);
  input.pack();
  input.setLocationRelativeTo(mainWindow);
  input.setVisible(true);	// BLOCKING
  return new String(textField.getPassword());
}
origin: stackoverflow.com

 private JPasswordField password;
  private String typedPassword;
  private final String defaultPassword = "yourDesiredPassword";

  public void createPasswordField(){

  password = new JPasswordField(30);
  password.setBounds(280, 240, 90, 20);
  password.setEchoChar('*');
  password.setBackground(Color.white);
  password.addActionListener(new ActionListener() {

    @Override
    public void actionPerformed(ActionEvent e) {

      password = (JPasswordField) e.getSource();
      char [] tempPass = password.getPassword();
      typedPassword = new String(tempPass);

      if (!typedPassword.equals(defaultPassword)){

        JOptionPane.showMessageDialog(null,
      "Your password is not correct",
      "Stack Over Flow example",
      JOptionPane.ERROR_MESSAGE);
      }
    }
  });
}
origin: IanDarwin/darwinsys-api

/**
 * Prompt for a password, and wait until the user enters it.
 * @param prompt The prompt string
 * @return The new password.
 */
@SuppressWarnings("serial")
private String getPassword(String prompt) {
  final JDialog input = new JDialog(mainWindow, "Prompt", true);
  input.setLayout(new FlowLayout());
  input.add(new JLabel(prompt));
  JPasswordField textField = new JPasswordField(10);
  input.add(textField);
  Action okAction = new AbstractAction("OK") {
    public void actionPerformed(ActionEvent e) {
      input.dispose();
    }
  };
  textField.addActionListener(okAction);
  JButton ok = new JButton(okAction);
  input.add(ok);
  input.pack();
  input.setLocationRelativeTo(mainWindow);
  input.setVisible(true);	// BLOCKING
  return new String(textField.getPassword());
}
origin: apache/batik

JPassword = new JPasswordField(20);
JPassword.setEchoChar('*');
JPassword.addActionListener(okListener);
gridBag.setConstraints(JPassword, c);
proxyPanel.add(JPassword);
origin: stackoverflow.com

public static void main(String[] args)
{
 SwingUtilities.invokeLater(new Runnable() {
  @Override
  public void run()
  {
   JFrame frame = new JFrame("Password Login System");
   frame.setSize(400, 100);
   frame.setResizable(false);
   frame.setVisible(true);
   frame.setBackground(Color.WHITE);
   frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
   frame.setLocationRelativeTo(null);
   JPanel panel = new JPanel();
   JLabel label = new JLabel("Enter Password: ");
   JPasswordField pass = new JPasswordField(10);
   pass.setEchoChar('*');
   pass.addActionListener(new AL());
   panel.add(label, BorderLayout.WEST);
   panel.add(pass, BorderLayout.EAST);
   frame.add(panel);
   frame.validate();
  }
 });
}
origin: guigarage/JavaVersionChanger

passwordField.addActionListener(closeDialogActionListener);
dialog.getContentPane().add(passwordField, BorderLayout.CENTER);
JButton okButton = new JButton("ok");
origin: com.synaptix/SynaptixSwing

private void initComponents() {
  glassPane = new JWaitGlassPane(JWaitGlassPane.TYPE_DIRECTION_PING_PONG, "", null, null); //$NON-NLS-1$
  loginComboBoxModel = new LoginComboBoxModel();
  loginBox = new JComboBox(loginComboBoxModel);
  loginBox.setEditable(true);
  loginField = (JTextField) loginBox.getEditor().getEditorComponent();
  loginField.addActionListener(connectionAction);
  loginField.getDocument().addDocumentListener(new LoginDocumentListener());
  passwordField = new JPasswordField();
  passwordField.addActionListener(connectionAction);
  loginField.setPreferredSize(passwordField.getPreferredSize());
  passwordField.setPreferredSize(loginBox.getPreferredSize());
  saveLoginBox = new JCheckBox(ProfilMessages.getString("LoginDialog.5")); //$NON-NLS-1$
  saveLoginBox.addChangeListener(new SaveLoginBoxChangeListener());
  savePasswordBox = new JCheckBox(ProfilMessages.getString("LoginDialog.6")); //$NON-NLS-1$
  savePasswordBox.setEnabled(false);
  iconKeyLabel = new JLabel(ICON_KEY);
  deleteButton = new JButton(deleteAction);
  deleteButton.setBorderPainted(false);
  deleteButton.setFocusable(false);
}
origin: com.eas.platypus/platypus-js-forms

public VPasswordField(String aText) {
  super.setText(aText != null ? aText : "");
  if (aText == null) {
    nullValue = true;
  }
  oldValue = aText;
  super.addFocusListener(new FocusAdapter() {
    @Override
    public void focusLost(FocusEvent e) {
      checkValueChanged();
    }
  });
  super.addActionListener((java.awt.event.ActionEvent e) -> {
    checkValueChanged();
  });
}
origin: AlexanderBartash/hybris-integration-intellij-idea-plugin

hacWebrootTextField.addActionListener(action->saveSettings());
loginTextField.addActionListener(action->saveSettings());
passwordField.addActionListener(action->saveSettings());
testConnectionButton.addActionListener(action->testConnection());
origin: net.java.openjdk.cacio/cacio-shared

@Override
JPasswordField initSwingComponent() {
  
  TextField textField = getAWTComponent();
  JPasswordField swingComponent = new JPasswordField();
  swingComponent.setText(textField.getText());
  swingComponent.setColumns(textField.getColumns());
  swingComponent.setEchoChar(textField.getEchoChar());
  swingComponent.setEditable(textField.isEditable());
  swingComponent.select(textField.getSelectionStart(),
             textField.getSelectionEnd());
  
  swingComponent.addActionListener(new SwingTextFieldListener());
  return swingComponent;
}

javax.swingJPasswordFieldaddActionListener

Popular methods of JPasswordField

  • <init>
  • getPassword
  • setText
  • setEnabled
  • addKeyListener
  • setColumns
  • getDocument
  • setEchoChar
  • requestFocusInWindow
  • setEditable
  • setPreferredSize
  • addFocusListener
  • setPreferredSize,
  • addFocusListener,
  • setFont,
  • setToolTipText,
  • setName,
  • getEchoChar,
  • getText,
  • requestFocus,
  • setDocument

Popular in Java

  • Start an intent from android
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • findViewById (Activity)
  • getSupportFragmentManager (FragmentActivity)
  • GridLayout (java.awt)
    The GridLayout class is a layout manager that lays out a container's components in a rectangular gri
  • Menu (java.awt)
  • Window (java.awt)
    A Window object is a top-level window with no borders and no menubar. The default layout for a windo
  • Charset (java.nio.charset)
    A charset is a named mapping between Unicode characters and byte sequences. Every Charset can decode
  • ReentrantLock (java.util.concurrent.locks)
    A reentrant mutual exclusion Lock with the same basic behavior and semantics as the implicit monitor
  • Scheduler (org.quartz)
    This is the main interface of a Quartz Scheduler. A Scheduler maintains a registry of org.quartz.Job
  • CodeWhisperer alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now