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

How to use
getEchoChar
method
in
javax.swing.JPasswordField

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

origin: kaikramer/keystore-explorer

/**
 * Get echo character.
 *
 * @return Echo character
 */
public char getEchoChar() {
  return jpfPassword.getEchoChar();
}
origin: stackoverflow.com

JPasswordField jpf = new JPasswordField();
jpf.getEchoChar();
origin: org.netbeans.modules/org-netbeans-modules-docker-ui

private void showPasswordCheckBoxItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_showPasswordCheckBoxItemStateChanged
  if (showPasswordCheckBox.isSelected()) {
    passwordPasswordField.setEchoChar((char) 0);
  } else {
    passwordPasswordField.setEchoChar(reference.getEchoChar());
  }
}//GEN-LAST:event_showPasswordCheckBoxItemStateChanged
origin: org.netbeans.modules/org-netbeans-modules-tomcat5

private void showButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_showButtonActionPerformed
  if (!passwordVisible) {
    passwordVisible = true;
    originalFont = passwordField.getFont();
    passwordField.setFont(usernameTextField.getFont());
    originalEchoChar = passwordField.getEchoChar();
    passwordField.setEchoChar((char) 0);
    Mnemonics.setLocalizedText(showButton, NbBundle.getMessage(CustomizerGeneral.class, "LBL_ShowButtonHide"));
    showButton.setToolTipText(NbBundle.getMessage(CustomizerGeneral.class, "LBL_ShowButtonHide_ToolTip"));
  } else {
    passwordVisible = false;
    passwordField.setFont(originalFont);
    passwordField.setEchoChar(originalEchoChar);
    Mnemonics.setLocalizedText(showButton, NbBundle.getMessage(CustomizerGeneral.class, "CustomizerGeneral.showButton.text"));
    showButton.setToolTipText(NbBundle.getMessage(CustomizerGeneral.class, "CustomizerGeneral.showButton.toolTipText"));
    
  }
}//GEN-LAST:event_showButtonActionPerformed

origin: gaborbata/jpass

this.ORIGINAL_ECHO = this.passwordField.getEchoChar();
this.fieldPanel.add(this.passwordField);
origin: stackoverflow.com

if (0 != pwf.getEchoChar()) {
  echoChar = pwf.getEchoChar();
origin: net.sf.nimrod/nimrod-laf

public Shape modelToView( int pos, Shape a, Position.Bias b) throws BadLocationException {
  Container c = getContainer();
  if ( c instanceof JPasswordField ) {
   JPasswordField f = (JPasswordField)c;
   if ( !f.echoCharIsSet() ) {
     return super.modelToView( pos, a, b);
   }
    
  char echoChar = f.getEchoChar();
   int w = f.getFontMetrics( f.getFont()).charWidth( echoChar);
   w = ( w < ancho ? ancho : w) + hueco;
   
   Rectangle alloc = adjustAllocation( a).getBounds();
   int dx = (pos - getStartOffset()) * w;
   alloc.x += dx - 2;
  if ( alloc.x <= 5 ) {
   alloc.x = 6;
  }
   alloc.width = 1;
   
   return alloc;
  }
  
  return null;
}
 
origin: org.activecomponents.jadex/jadex-runtimetools-swing

final JLabel	lbpass	= new JLabel("Password");
tfpass    = new JPasswordField(10);
final char	echo	= tfpass.getEchoChar();
final JButton	buapply	= new JButton("Apply");
cbshowchars    = new JCheckBox("Show characters");
origin: net.sourceforge.jadex/jadex-runtimetools-swing

final JLabel	lbpass	= new JLabel("Password");
tfpass    = new JPasswordField(10);
final char	echo	= tfpass.getEchoChar();
final JButton	buapply	= new JButton("Apply");
cbshowchars    = new JCheckBox("Show characters");
origin: com.github.insubstantial/substance

@Override
protected int drawSelectedText(Graphics g, final int x, final int y,
    int p0, int p1) throws BadLocationException {
  Container c = getContainer();
  if (c instanceof JPasswordField) {
    JPasswordField f = (JPasswordField) c;
    if (!f.echoCharIsSet()) {
      return super.drawSelectedText(g, x, y, p0, p1);
    }
    int n = p1 - p0;
    char echoChar = f.getEchoChar();
    int currPos = x;
    for (int i = 0; i < n; i++) {
      currPos = drawEchoCharacter(g, currPos, y, echoChar, true);
    }
    return x + n * getEchoCharAdvance();
  }
  return x;
}
origin: org.java.net.substance/substance

@Override
protected int drawUnselectedText(Graphics g, final int x, final int y,
    int p0, int p1) throws BadLocationException {
  Container c = getContainer();
  if (c instanceof JPasswordField) {
    JPasswordField f = (JPasswordField) c;
    if (!f.echoCharIsSet()) {
      return super.drawUnselectedText(g, x, y, p0, p1);
    }
    int n = p1 - p0;
    char echoChar = f.getEchoChar();
    int currPos = x;
    for (int i = 0; i < n; i++) {
      currPos = drawEchoCharacter(g, currPos, y, echoChar, false);
    }
    return x + n * getEchoCharAdvance();
  }
  return x;
}
origin: net.sf.nimrod/nimrod-laf

 public int viewToModel( float fx, float fy, Shape a, Position.Bias[] bias) {
   bias[0] = Position.Bias.Forward;
   int n = 0;
   Container c = getContainer();
   if ( c instanceof JPasswordField ) {
    JPasswordField f = (JPasswordField)c;
    if ( !f.echoCharIsSet() ) {
      return super.viewToModel( fx, fy, a, bias);
    }
    
    char echoChar = f.getEchoChar();
    int w = f.getFontMetrics( f.getFont()).charWidth( echoChar);
    w = ( w < ancho ? ancho : w) + hueco;
    
    a = adjustAllocation( a);
    Rectangle alloc = (a instanceof Rectangle) ? (Rectangle)a : a.getBounds();
    n = ((int)fx - alloc.x) / w;
    if (n < 0) {
      n = 0;
    }
    else if ( n > (getStartOffset() + getDocument().getLength()) ) {
      n = getDocument().getLength() - getStartOffset();
    }
   }
   
  return getStartOffset() + n;
 }
}
origin: com.github.insubstantial/substance

@Override
protected int drawUnselectedText(Graphics g, final int x, final int y,
    int p0, int p1) throws BadLocationException {
  Container c = getContainer();
  if (c instanceof JPasswordField) {
    JPasswordField f = (JPasswordField) c;
    if (!f.echoCharIsSet()) {
      return super.drawUnselectedText(g, x, y, p0, p1);
    }
    int n = p1 - p0;
    char echoChar = f.getEchoChar();
    int currPos = x;
    for (int i = 0; i < n; i++) {
      currPos = drawEchoCharacter(g, currPos, y, echoChar, false);
    }
    return x + n * getEchoCharAdvance();
  }
  return x;
}
origin: org.java.net.substance/substance

@Override
protected int drawSelectedText(Graphics g, final int x, final int y,
    int p0, int p1) throws BadLocationException {
  Container c = getContainer();
  if (c instanceof JPasswordField) {
    JPasswordField f = (JPasswordField) c;
    if (!f.echoCharIsSet()) {
      return super.drawSelectedText(g, x, y, p0, p1);
    }
    int n = p1 - p0;
    char echoChar = f.getEchoChar();
    int currPos = x;
    for (int i = 0; i < n; i++) {
      currPos = drawEchoCharacter(g, currPos, y, echoChar, true);
    }
    return x + n * getEchoCharAdvance();
  }
  return x;
}
javax.swingJPasswordFieldgetEchoChar

Popular methods of JPasswordField

  • <init>
  • getPassword
  • setText
  • setEnabled
  • addActionListener
  • addKeyListener
  • setColumns
  • getDocument
  • setEchoChar
  • requestFocusInWindow
  • setEditable
  • setPreferredSize
  • setEditable,
  • setPreferredSize,
  • addFocusListener,
  • setFont,
  • setToolTipText,
  • setName,
  • 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)
  • GridBagLayout (java.awt)
    The GridBagLayout class is a flexible layout manager that aligns components vertically and horizonta
  • InetAddress (java.net)
    An Internet Protocol (IP) address. This can be either an IPv4 address or an IPv6 address, and in pra
  • HashMap (java.util)
    HashMap is an implementation of Map. All optional operations are supported.All elements are permitte
  • ReentrantLock (java.util.concurrent.locks)
    A reentrant mutual exclusion Lock with the same basic behavior and semantics as the implicit monitor
  • Response (javax.ws.rs.core)
    Defines the contract between a returned instance and the runtime when an application needs to provid
  • Project (org.apache.tools.ant)
    Central representation of an Ant project. This class defines an Ant project with all of its targets,
  • From CI to AI: The AI layer in your organization
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