Tabnine Logo
JPasswordField.setBackground
Code IndexAdd Tabnine 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)

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

  • 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,
  • Top PhpStorm plugins
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