Skip to content

Instantly share code, notes, and snippets.

@HashRaygoza
Created February 13, 2020 00:28
Show Gist options
  • Select an option

  • Save HashRaygoza/637815bee1a0d05bc780bde54420f6b7 to your computer and use it in GitHub Desktop.

Select an option

Save HashRaygoza/637815bee1a0d05bc780bde54420f6b7 to your computer and use it in GitHub Desktop.
Interfaz del ejemplo con banda magnética
package com.hash.databaseio.doclistener;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JPasswordField;
/**
*
* @author draygoza
*/
public class PanelPrincipal extends JPanel {
private final JPasswordField campoPassword;
JLabel label = new JLabel("Por favor lea la tarjeta de banda magnetica");
public PanelPrincipal() {
campoPassword = new JPasswordField(100);
campoPassword.getDocument().addDocumentListener(new CuentaCaracteres(campoPassword) );
this.prepararInterfaz();
}
private void prepararInterfaz() {
setLayout(new GridBagLayout());
GridBagConstraints gbc = new GridBagConstraints();
gbc.gridwidth = GridBagConstraints.REMAINDER;
add(campoPassword, gbc);
add(label, gbc);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment