Created
February 13, 2020 00:28
-
-
Save HashRaygoza/637815bee1a0d05bc780bde54420f6b7 to your computer and use it in GitHub Desktop.
Interfaz del ejemplo con banda magnética
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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