Codota Logo
JPasswordField.setBackground
Code IndexAdd Codota to your IDE (free)

How to use
setBackground
method
in
javax.swing.JPasswordField

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

  • Common ways to obtain JPasswordField
private void myMethod () {
JPasswordField j =
  • Codota Iconnew JPasswordField()
  • Codota Iconnew JPasswordField(int1)
  • Codota IconString str;new JPasswordField(str)
  • Smart code suggestions by Codota
}
origin: Multibit-Legacy/multibit-hd

 /**
  * Handles the UI feedback for an incorrect credentials
  */
 public void incorrectPassword() {

  Preconditions.checkState(SwingUtilities.isEventDispatchThread(), "Must execute on EDT.");

  password.setBackground(Themes.currentTheme.invalidDataEntryBackground());

 }
}
origin: martin-lizner/trezor-ssh-agent

private void addLabelArea() {
  labelPanel.setLayout(new GridLayout(3, 1));
  Border labelsPadding = BorderFactory.createEmptyBorder(0, 0, 15, 0);
  labelPanel.setBorder(labelsPadding);
  deviceLabel = new JLabel(AgentConstants.APP_PUBLIC_NAME.toUpperCase());
  Icon icon = new ImageIcon(TrayProcess.createImage(AgentConstants.ICON24_PATH, AgentConstants.ICON_DESCRIPTION));
  deviceLabel.setBorder(BorderFactory.createEmptyBorder(0, 0, 5, 0));
  deviceLabel.setIcon(icon);
  deviceLabel.setIconTextGap(10);
  deviceLabel.setFont(new Font(null, Font.BOLD, 15));
  passcodeLabel = new JLabel(LocalizedLogger.getLocalizedMessage("DIALOG_ENTER_PIN"));
  passcodeField = new JPasswordField(3);
  passcodeField.setEditable(false);
  passcodeField.setBackground(Color.white);
  labelPanel.add(deviceLabel, BorderLayout.NORTH);
  labelPanel.add(passcodeLabel, BorderLayout.CENTER);
  labelPanel.add(passcodeField, BorderLayout.SOUTH);
}
origin: martin-lizner/trezor-ssh-agent

private void addInputArea() {
  labelPanel.setLayout(new GridLayout(3, 1));
  Border labelsPadding = BorderFactory.createEmptyBorder(0, 0, 15, 0);
  labelPanel.setBorder(labelsPadding);
  deviceLabel = new JLabel(AgentConstants.APP_PUBLIC_NAME.toUpperCase());
  Icon icon = new ImageIcon(TrayProcess.createImage(AgentConstants.ICON24_PATH, AgentConstants.ICON_DESCRIPTION));
  deviceLabel.setBorder(BorderFactory.createEmptyBorder(0, 0, 5, 0));
  deviceLabel.setIcon(icon);
  deviceLabel.setIconTextGap(10);
  deviceLabel.setFont(new Font(null, Font.BOLD, 15));
  passcodeLabel = new JLabel(LocalizedLogger.getLocalizedMessage("DIALOG_ENTER_PASSPHRASE"));
  passcodeField = new JPasswordField();
  passcodeField.requestFocusInWindow();
  passcodeField.setBackground(Color.white);
  labelPanel.add(deviceLabel, BorderLayout.NORTH);
  labelPanel.add(passcodeLabel, BorderLayout.CENTER);
  labelPanel.add(passcodeField, BorderLayout.SOUTH);
}
origin: Multibit-Legacy/multibit-hd

/**
 * Trigger any UI updates
 */
private void updateModel() {
 // Reset the credentials background
 password.setBackground(Themes.currentTheme.dataEntryBackground());
 getModel().get().setPassword(password.getPassword());
}
origin: org.zaproxy/zap

private void setProxyChainPromptEnabled(boolean isEnabled) {
  txtProxyChainPassword.setEnabled(!isEnabled);
  chkShowPassword.setEnabled(!isEnabled);
  
  Color color = Color.WHITE;
  if (isEnabled) {
    txtProxyChainPassword.setText("");
    color = panelProxyChain.getBackground();
  }
  txtProxyChainPassword.setBackground(color);
  
}
 
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: triplea-game/triplea

private void setWidgetActivation() {
 passwordField.setEnabled(requirePasswordCheckBox.isSelected());
 final Color backGround = passwordField.isEnabled() ? portField.getBackground() : getBackground();
 passwordField.setBackground(backGround);
}
origin: atarw/material-ui-swing

@Override
public void installUI (JComponent c) {
  super.installUI (c);
  JPasswordField passwordField = (JPasswordField) c;
  passwordField.setOpaque (false);
  passwordField.setBorder (BorderFactory.createEmptyBorder (5, 2, 10, 0));
  passwordField.setBackground (MaterialColors.LIGHT_BLUE_400);
  this.focusedBackground = passwordField.getBackground ();
  this.unfocusedBackground = MaterialColors.GRAY_200;
  this.focusedSelectionBackground = MaterialColors.bleach (focusedBackground, 0.3f);
  this.unfocusedSelectionBackground = unfocusedBackground;
}
origin: org.zaproxy/zap

private void setProxyChainAuthEnabled(boolean isEnabled) {
  txtProxyChainRealm.setEnabled(isEnabled);
  txtProxyChainUserName.setEnabled(isEnabled);
  txtProxyChainPassword.setEnabled(isEnabled);
  // ZAP: Added prompt option
  chkProxyChainPrompt.setEnabled(isEnabled);
  chkShowPassword.setEnabled(isEnabled);
  
  if (chkProxyChainPrompt.isSelected()) {
    setProxyChainPromptEnabled(true);
  }
  Color color = Color.WHITE;
  if (!isEnabled) {
    // ZAP: Added prompt option
    color = panelProxyChain.getBackground();
  }
  txtProxyChainRealm.setBackground(color);
  txtProxyChainUserName.setBackground(color);
  txtProxyChainPassword.setBackground(color);
  
}
 
origin: atarw/material-ui-swing

@Override
public void paintSafely (Graphics g) {
  JPasswordField c = (JPasswordField) getComponent ();
  g = MaterialDrawingUtils.getAliasedGraphics (g);
  if (getComponent ().hasFocus ()) {
    c.setBackground (focusedBackground);
    c.setSelectionColor (focusedSelectionBackground);
  }
  else {
    c.setBackground (unfocusedBackground);
    c.setSelectionColor (unfocusedSelectionBackground);
  }
  int x = getComponent ().getInsets ().left;
  int y = getComponent ().getInsets ().top;
  int w = getComponent ().getWidth () - getComponent ().getInsets ().left - getComponent ().getInsets ().right;
  g.setColor (c.getBackground ());
  g.fillRect (x, c.getHeight () - y, w, 2);
  super.paintSafely (g);
}
origin: Multibit-Legacy/multibit-hd

passwordField.setBackground(Themes.currentTheme.dataEntryBackground());
javax.swingJPasswordFieldsetBackground

Popular methods of JPasswordField

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

Popular in Java

  • Running tasks concurrently on multiple threads
  • setScale (BigDecimal)
  • getExternalFilesDir (Context)
  • addToBackStack (FragmentTransaction)
  • MessageDigest (java.security)
    Uses a one-way hash function to turn an arbitrary number of bytes into a fixed-length byte sequence.
  • SecureRandom (java.security)
    This class generates cryptographically secure pseudo-random numbers. It is best to invoke SecureRand
  • HashSet (java.util)
    This class implements the Set interface, backed by a hash table (actually a HashMap instance). It m
  • List (java.util)
    A List is a collection which maintains an ordering for its elements. Every element in the List has a
  • JComboBox (javax.swing)
  • FileUtils (org.apache.commons.io)
    General file manipulation utilities. Facilities are provided in the following areas: * writing to a
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now