loginText = new JTextField();
userLabel = new JLabel();
passwordText = new JPasswordField();
passwordLabel = new JLabel();
GroupLayout myBottomLayout = new GroupLayout(wallpaper);
wallpaper.setLayout(myBottomLayout);
myBottomLayout.setHorizontalGroup(
myBottomLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
.addGroup(myBottomLayout.createSequentialGroup()
.addGap(41, 41, 41)
.addGroup(myBottomLayout.createParallelGroup(GroupLayout.Alignment.LEADING, false)
.addComponent(passwordLabel, GroupLayout.Alignment.TRAILING, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(userLabel, GroupLayout.Alignment.TRAILING))
.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
.addGroup(myBottomLayout.createParallelGroup(GroupLayout.Alignment.LEADING, false)
.addComponent(loginText)
.addComponent(passwordText, GroupLayout.PREFERRED_SIZE, 147, GroupLayout.PREFERRED_SIZE))
.addContainerGap(413, Short.MAX_VALUE))
);
loginText.addKeyListener(new java.awt.event.KeyAdapter() {
public void keyPressed(java.awt.event.KeyEvent evt) {
if ( evt.getKeyCode() == KeyEvent.VK_ENTER ){
passwordText.requestFocus();
}
}
});
setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
setTitle(Constants.appName);
userLabel.setFont(new Font("Courier New", 0, 12));
userLabel.setHorizontalAlignment(SwingConstants.CENTER);
userLabel.setIcon(new ImageIcon(getClass().getResource("/totalpos/resources/Etiquetas.jpg"))); // NOI18N
userLabel.setText("Usuario");
userLabel.setHorizontalTextPosition(SwingConstants.CENTER);
userLabel.setIconTextGap(0);
passwordText.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
passwordTextActionPerformed(evt);
}
});
passwordLabel.setFont(new Font("Courier New", 0, 12));
passwordLabel.setIcon(new ImageIcon(getClass().getResource("/totalpos/resources/Etiquetas.jpg"))); // NOI18N
passwordLabel.setText("Contraseña");
passwordLabel.setHorizontalTextPosition(SwingConstants.CENTER);
myBottomLayout.setVerticalGroup(
myBottomLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
.addGroup(GroupLayout.Alignment.TRAILING, myBottomLayout.createSequentialGroup()
.addContainerGap(396, Short.MAX_VALUE)
.addGroup(myBottomLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
.addComponent(userLabel)
.addComponent(loginText, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
.addGroup(myBottomLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
.addComponent(passwordLabel)
.addComponent(passwordText, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
.addGap(78, 78, 78))
);
GroupLayout layout = new GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(GroupLayout.Alignment.LEADING)
.addComponent(wallpaper, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
);
layout.setVerticalGroup(
layout.createParallelGroup(GroupLayout.Alignment.LEADING)
.addComponent(wallpaper, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
);
pack();