to usando um pequeno programa chamado tinapos, ele é open-source, sendo que ele funciona normalmente quando instalo, mas quando tento rodar no eclipse dá esse erro acima, olhem o código sem alteração dessa classe que inicializa o programa.
// Tina POS is a point of sales application designed for touch screens.
// Copyright (C) 2005 Adri�n Romero Corchado.
// http://sourceforge.net/projects/tinapos
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
package net.adrianromero.tpv.forms;
/**
*
* @author Administrador
* @version
*/
import java.awt.CardLayout;
import java.awt.Cursor;
import java.awt.Dimension;
import java.awt.DisplayMode;
import java.awt.GraphicsDevice;
import java.awt.GraphicsEnvironment;
import java.awt.Image;
import java.awt.Toolkit;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.awt.image.BufferedImage;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.sql.SQLException;
import javax.imageio.ImageIO;
import javax.swing.AbstractAction;
import javax.swing.Action;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
import javax.swing.SwingConstants;
import net.adrianromero.dataconnection.ConnectionContext;
import net.adrianromero.dataconnection.DefaultConnectionContext;
import net.adrianromero.datagui.JMessageDialog;
import net.adrianromero.datagui.MessageInf;
import net.adrianromero.dataloader.BaseSentence;
import net.adrianromero.dataloader.BatchSentence;
import net.adrianromero.dataloader.DataException;
import net.adrianromero.dataloader.SerializerReadString;
import net.adrianromero.dataloader.StaticSentence;
import net.adrianromero.dataloader.TableDefinition;
import net.adrianromero.tpv.images.ThumbNailBuilder;
import net.adrianromero.tpv.printer.DeviceTicket;
import net.adrianromero.tpv.printer.TicketParser;
import org.apache.velocity.Template;
import org.apache.velocity.app.VelocityEngine;
public class JFrmTPV extends JFrame implements AppView {
private DeviceTicket m_TP;
private TicketParser m_TTP;
private VelocityEngine m_ve;
private SentenceContainer m_sentences;
private DefaultConnectionContext m_cnt;
private JPrincipalApp m_principalapp = null;
private AppUser m_AppUserLogging = null; // Usuario al que se le est� pidiendo la password
private int m_intentos;
private AppUser m_AppUser = null;
private String m_sHost = null;
private AppConfig m_config;
/** Creates new form JFrmTPV */
private JFrmTPV() {
}
/** Arrancamos la aplicaci�n de TPV */
private boolean startTPV() {
// Leo la configuraci�n
m_config = new AppConfig();
m_config.load();
// Inicializo los componentes visuales
initComponents ();
// setIconImage(new ImageIcon(getClass().getResource("/net/adrianromero/tpv/images/tinapos.png")).getImage());
// Inicializo el nombre del host
m_sHost = getProperty("machine.hostname");
m_jHost.setText(AppLocal.getIntString("label.host") + m_sHost);
// Inicializo la conexi�n contra la base de datos.
m_cnt = new DefaultConnectionContext(
getProperty("db.driver"),
getProperty("db.URL"),
getProperty("db.user"),
getProperty("db.password")
);
try {
m_cnt.login();
} catch (ClassNotFoundException eCNF) {
JMessageDialog.showMessage(this, new MessageInf(MessageInf.SGN_DANGER, AppLocal.getIntString("message.databasedrivererror"), eCNF));
return false;
} catch (SQLException eSQL) {
JMessageDialog.showMessage(this, new MessageInf(MessageInf.SGN_DANGER, AppLocal.getIntString("message.databaseconnectionerror"), eSQL));
return false; // error
}
// Inicializo las sentencias
m_sentences = SentenceContainerGeneric.getInstance(m_cnt);
if (m_sentences == null) {
JMessageDialog.showMessage(this, new MessageInf(MessageInf.SGN_DANGER, AppLocal.getIntString("message.databasenotsupported", new String[]{m_cnt.getStorageName()})));
return false; // error
}
// Inicializo Velocity
m_ve = new VelocityEngine();
// ve.setProperty(VelocityEngine.RUNTIME_LOG_LOGSYSTEM, this);
m_ve.setProperty(VelocityEngine.RESOURCE_LOADER, "class");
// m_ve.setProperty("class.resource.loader.description", "Velocity Classpath Resource Loader");
// m_ve.setProperty("class.resource.loader.class", "org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader");
m_ve.setProperty("class.resource.loader.class", "net.adrianromero.tpv.forms.SentenceResourceLoader");
m_ve.setProperty("class.resource.loader.description", "Velocity Tina POS Resource Loader");
m_ve.setProperty("class.resource.loader.appresources", this);
m_ve.setProperty(VelocityEngine.RUNTIME_LOG_LOGSYSTEM_CLASS, "org.apache.velocity.runtime.log.NullLogSystem");
m_ve.setProperty(VelocityEngine.ENCODING_DEFAULT, "UTF-8");
m_ve.setProperty(VelocityEngine.INPUT_ENCODING, "UTF-8");
try {
m_ve.init();
} catch (Exception e) {
System.out.println(e.getMessage());
e.printStackTrace();
m_ve = null;
}
// Inicializo la impresora...
m_TP = new DeviceTicket(getProperty("machine.printer"), getProperty("machine.display")); // antes "COM1"
// Inicializo el parser de documentos de ticket
m_TTP = new TicketParser(m_TP, this);
// Ponemos los estados
m_jIsPrinter.setText(m_TP.getPrinterName());
m_jIsPrinter.setToolTipText(m_TP.getPrinterDescription());
m_jIsDisplay.setText(m_TP.getDisplayName());
m_jIsDisplay.setToolTipText(m_TP.getDisplayDescription());
// Pinto algo bonito para empezar
m_TP.writeTimeVisor(AppLocal.getIntString("Visor.Title"));
// Los eventos de los elementos que existen
m_jClose.addActionListener(new CloseListener());
addWindowListener(new MyFrameListener());
// Comprobamos si existe la base de datos
String sScript = m_sentences.getInitScript() + "_" + getDataBaseVersion() + ".sql";
if (JFrmTPV.class.getResource(sScript) != null) {
// hay un script para actualizar o crear la base de datos.
if (JOptionPane.showConfirmDialog(this, AppLocal.getIntString("message.createdatabase"), AppLocal.getIntString("message.title"), JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE) == JOptionPane.YES_OPTION) {
try {
java.util.List l = new BatchSentence(m_cnt, sScript).list();
if (l.size() > 0) {
JMessageDialog.showMessage(this, new MessageInf(MessageInf.SGN_WARNING, AppLocal.getIntString("Database.ScriptWarning"), l.toArray(new Throwable[l.size()])));
}
} catch (DataException e) {
JMessageDialog.showMessage(this, new MessageInf(MessageInf.SGN_DANGER, AppLocal.getIntString("Database.ScriptError"), e));
try {
m_cnt.logoff();
} catch (SQLException eSQL) {
}
return false;
}
} else {
// sin base de datos no hay registradora.
return false;
}
}
// Leemos los recursos b�sicos
BufferedImage imgicon = getResourceAsImage("Window.Logo");
m_jLblTitle.setIcon(imgicon == null ? null : new ImageIcon(imgicon));
m_jLblTitle.setText(getResourceAsString("Window.Title"));
m_jIsPrinter.setVisible(false);
m_jIsDisplay.setVisible(false);
// Show Login
m_AppUser = null;
m_jUser.setVisible(false);
listPeople();
showView("login");
showLogonView("logonname");
if ("fullscreen".equals(getProperty("machine.screenmode"))) {
// muestro la ventana
GraphicsDevice myDevice = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice();
DisplayMode newDisplayMode = new DisplayMode(1024, 768, 32, 60);
DisplayMode oldDisplayMode = myDevice.getDisplayMode();
try {
setUndecorated(true);
myDevice.setFullScreenWindow(this);
myDevice.setDisplayMode(newDisplayMode);
} catch (IllegalArgumentException eIA) {
}
} else {
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
setBounds((screenSize.width - 1024) / 2, (screenSize.height - 768) / 2, 1024, 768);
// setExtendedState(JFrame.MAXIMIZED_BOTH);
}
// Mostramos el formulario principal...
setVisible(true);
// Finalizamos con �xito.
return true;
}
public static void main (String args[])
{
JFrmTPV app = new JFrmTPV();
java.awt.EventQueue.invokeLater(new Runnable()
{
public void run()
{
JFrmTPV app = new JFrmTPV();
if (!app.startTPV()) {
// No se ha iniciado correctamente, entonces nos vamos con un disgusto.
System.exit(1);
}
}
});
}
private String getDataBaseVersion() {
try {
return (String) new StaticSentence(m_cnt, "SELECT VERSION FROM TINAPOS", null, SerializerReadString.INSTANCE).find();
} catch (DataException ed) {
}
// Comprobamos si existe la base de datos
try {
new StaticSentence(m_cnt, "SELECT * FROM PEOPLE WHERE 1 = 0").exec();
return "0.0.6";
} catch (DataException e) {
return "create";
}
}
// private void addResource(String sKey, int iType, String sResourceJava) throws DataException {
// Object[] data = new Object[3];
// data[0] = sKey;
// data[1] = new Integer(iType);
//
//
// InputStream in = this.getClass().getResourceAsStream(sResourceJava);
// byte[] buffer = new byte[1024];
// byte[] resource = new byte[0];
// int n;
//
// try {
// while ((n = in.read(buffer)) != -1) {
// byte[] b = new byte[resource.length + n];
// System.arraycopy(resource, 0, b, 0, resource.length);
// System.arraycopy(buffer, 0, b, resource.length, n);
// resource = b;
// }
// data[2] = resource;
// in.close();
// } catch (IOException e) {
// data[2] = null;
// }
//
// getTableDefinition("resources").getInsertSentence().exec(data);
// }
// Interfaz de aplicaci�n
public DeviceTicket getDeviceTicket(){
return m_TP;
}
public TicketParser getTicketParser(){
return m_TTP;
}
public Template getTemplate(String sTemplate) {
if (m_ve == null) {
return null;
} else {
try {
return m_ve.getTemplate(sTemplate);
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
}
public ConnectionContext getConnectionContext() {
return m_cnt;
}
public BaseSentence getSentence(String sSent) {
return m_sentences.getSentence(sSent);
}
public TableDefinition getTableDefinition(String sTable) {
return m_sentences.getTableDefinition(sTable);
}
public byte[] getResource(String sName) {
try {
return (byte[]) getSentence("getResourceBytes").find(sName);
} catch (DataException e) {
return null;
}
}
public String getResourceAsString(String sName) {
try {
byte[] str = getResource(sName);
return new String(str, "UTF-8");
} catch (UnsupportedEncodingException e) {
return null;
}
}
public BufferedImage getResourceAsImage(String sName) {
try {
byte[] img = getResource(sName);
return img == null ? null : ImageIO.read(new ByteArrayInputStream(img));
} catch (IOException e) {
return null;
}
}
public AppUser getUser() {
return m_AppUser;
}
public String getHost() {
return m_sHost;
}
public String getProperty(String sKey) {
return m_config.getProperty(sKey);
}
private void listPeople() {
try {
m_jPeople.removeAll();
BaseSentence sent = getSentence("getPeopleVisible");
java.util.List people = sent.list();
Image defimg;
try {
defimg = ImageIO.read(getClass().getClassLoader().getResourceAsStream("net/adrianromero/tpv/images/yast_sysadmin.png"));
} catch (Exception fnfe) {
defimg = null;
}
ThumbNailBuilder tnb = new ThumbNailBuilder(32, 32, defimg);
for (int i = 0; i < people.size(); i++) {
Object[] value = (Object[]) people.get(i);
AppUser user = new AppUser(
new ImageIcon(tnb.getThumbNail((Image) value[3]))
, (String) value[0]
, (String) value[1]
, (String) value[2]);
JButton btn = new JButton(new AppUserAction(user));
btn.setFocusPainted(false);
btn.setFocusable(false);
btn.setRequestFocusEnabled(false);
btn.setHorizontalAlignment(SwingConstants.LEADING);
m_jPeople.add(btn);
}
} catch (DataException ee) {
ee.printStackTrace();
}
}
// La acci�n del selector
private class AppUserAction extends AbstractAction {
private AppUser m_actionuser;
public AppUserAction(AppUser user) {
m_actionuser = user;
putValue(Action.SMALL_ICON, m_actionuser.getIcon());
putValue(Action.NAME, m_actionuser.getName());
}
public AppUser getUser() {
return m_actionuser;
}
public void actionPerformed(ActionEvent evt) {
String sPassword = m_actionuser.getPassword();
if (m_actionuser.authenticate()) {
// p'adentro directo, no tiene password
openAppView(m_actionuser);
} else {
// comprobemos la clave antes de entrar...
m_AppUserLogging = m_actionuser;
m_jCurrentUser.setIcon(m_actionuser.getIcon());
m_jCurrentUser.setText(m_actionuser.getName());
m_intentos = 3;
m_jCurrentPassword.setText(null);
showLogonView("logonpassword");
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
m_jCurrentPassword.requestFocus();
}
});
}
}
}
private void showLogonView(String view) {
CardLayout cl = (CardLayout)(m_jLogonContainer.getLayout());
cl.show(m_jLogonContainer, view);
}
private void showView(String view) {
CardLayout cl = (CardLayout)(m_jPanelContainer.getLayout());
cl.show(m_jPanelContainer, view);
}
private void openAppView(AppUser user) {
// Muestro el panel principal
m_AppUser = user;
m_jUser.setIcon(m_AppUser.getIcon());
m_jUser.setText(AppLocal.getIntString("label.user") + m_AppUser.getName());
m_jUser.setVisible(true);
m_principalapp = new JPrincipalApp(this);
m_jPanelContainer.add(m_principalapp, "app");
showView("app");
}
public boolean closeAppView() {
// trato de desactivar la aplicaci�n principal
if (m_principalapp != null) {
if (!m_principalapp.deactivate()) {
return false;
}
m_jPanelContainer.remove(m_principalapp);
m_principalapp = null;
// Show Login
m_AppUser = null;
m_jUser.setVisible(false);
listPeople();
showView("login");
showLogonView("logonname");
}
return true;
}
public boolean showTask(String sTaskClass, Object params) {
return m_principalapp == null ? false : m_principalapp.showTask(sTaskClass, params);
}
public void waitCursorBegin() {
setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
}
public void waitCursorEnd(){
setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
}
private void tryToClose() {
if (closeAppView()) {
// me desconecto de la base de datos.
try {
if (m_cnt != null) {
m_cnt.logoff();
}
} catch (SQLException eSQL) {
}
// Descargo el formulario
dispose();
}
}
private void tryLogon() {
if (m_AppUserLogging != null) {
String sPwd = new String(m_jCurrentPassword.getPassword());
if (m_AppUserLogging.authenticate(sPwd)) {
openAppView(m_AppUserLogging);
m_AppUserLogging = null;
} else {
if ((--m_intentos) == 0) {
// se acabaron las pruebas
m_AppUserLogging = null;
showLogonView("logonname");
} else {
JOptionPane.showMessageDialog(JFrmTPV.this,
AppLocal.getIntString("message.BadPassword"),
m_AppUserLogging.getName(),
JOptionPane.WARNING_MESSAGE);
m_jCurrentPassword.setText(null);
}
}
}
}
/** Exit the Application */
/**
* @param args the command line arguments
*/
private class MyFrameListener extends WindowAdapter{
public void windowClosing(WindowEvent evt) {
tryToClose();
}
public void windowClosed(WindowEvent evt) {
System.exit(0);
}
}
private class CloseListener implements ActionListener {
public void actionPerformed(ActionEvent evt) {
tryToClose();
}
}
/** This method is called from within the constructor to
* initialize the form.
* WARNING: Do NOT modify this code. The content of this method is
* always regenerated by the FormEditor.
*/
private void initComponents() {//GEN-BEGIN:initComponents
m_jPanelTitle = new javax.swing.JPanel();
m_jLblTitle = new javax.swing.JLabel();
m_jPanelDown = new javax.swing.JPanel();
m_jHost = new javax.swing.JLabel();
m_jUser = new javax.swing.JLabel();
m_jIsPrinter = new javax.swing.JLabel();
m_jIsDisplay = new javax.swing.JLabel();
m_jPanelContainer = new javax.swing.JPanel();
m_jPanelLogin = new javax.swing.JPanel();
jLabel1 = new javax.swing.JLabel();
jPanel9 = new javax.swing.JPanel();
m_jLogonContainer = new javax.swing.JPanel();
m_jLogonPassword = new javax.swing.JPanel();
jPanel4 = new javax.swing.JPanel();
m_jCurrentUser = new javax.swing.JLabel();
m_jCurrentPassword = new javax.swing.JPasswordField();
jLabel2 = new javax.swing.JLabel();
jPanel7 = new javax.swing.JPanel();
jPanel1 = new javax.swing.JPanel();
m_jPasswordOK = new javax.swing.JButton();
m_jPasswordCancel = new javax.swing.JButton();
m_jLogonName = new javax.swing.JPanel();
jScrollPane1 = new javax.swing.JScrollPane();
jPanel3 = new javax.swing.JPanel();
m_jPeople = new javax.swing.JPanel();
jPanel2 = new javax.swing.JPanel();
jPanel8 = new javax.swing.JPanel();
m_jClose = new javax.swing.JButton();
setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE);
setTitle("TinaPOS");
m_jPanelTitle.setBackground(javax.swing.UIManager.getDefaults().getColor("InternalFrame.activeTitleBackground"));
m_jLblTitle.setForeground(javax.swing.UIManager.getDefaults().getColor("InternalFrame.activeTitleForeground"));
m_jLblTitle.setText("Window.Title");
m_jPanelTitle.add(m_jLblTitle);
getContentPane().add(m_jPanelTitle, java.awt.BorderLayout.NORTH);
m_jPanelDown.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.LEFT));
m_jHost.setIcon(new javax.swing.ImageIcon(getClass().getResource("/net/adrianromero/tpv/images/display.png")));
m_jHost.setText("*Host");
m_jHost.setBorder(new javax.swing.border.CompoundBorder(new javax.swing.border.LineBorder(java.awt.Color.lightGray), new javax.swing.border.EmptyBorder(new java.awt.Insets(1, 5, 1, 5))));
m_jPanelDown.add(m_jHost);
m_jUser.setText("*User");
m_jUser.setBorder(new javax.swing.border.CompoundBorder(new javax.swing.border.LineBorder(java.awt.Color.lightGray), new javax.swing.border.EmptyBorder(new java.awt.Insets(1, 5, 1, 5))));
m_jPanelDown.add(m_jUser);
m_jIsPrinter.setText("*Printer");
m_jIsPrinter.setBorder(new javax.swing.border.CompoundBorder(new javax.swing.border.LineBorder(java.awt.Color.lightGray, 1, true), new javax.swing.border.EmptyBorder(new java.awt.Insets(1, 5, 1, 5))));
m_jPanelDown.add(m_jIsPrinter);
m_jIsDisplay.setText("*Display");
m_jIsDisplay.setBorder(new javax.swing.border.CompoundBorder(new javax.swing.border.LineBorder(java.awt.Color.lightGray, 1, true), new javax.swing.border.EmptyBorder(new java.awt.Insets(1, 5, 1, 5))));
m_jPanelDown.add(m_jIsDisplay);
getContentPane().add(m_jPanelDown, java.awt.BorderLayout.SOUTH);
m_jPanelContainer.setLayout(new java.awt.CardLayout());
m_jPanelLogin.setLayout(new java.awt.BorderLayout());
jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/net/adrianromero/tpv/images/tinapos.png")));
jLabel1.setText("<html><center>Tina POS \u00e9 uma aplica\u00e7\u00e3o de ponto de venda designada para funcionar com telas.<br> Copyright (C) 2005 Adri\u00e1n Romero Corchado.<br> http://sourceforge.net/projects/tinapos<br> [email removido]<br> <br> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.<br> <br> This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.<br> <br> You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA<br></center>");
jLabel1.setBorder(new javax.swing.border.EmptyBorder(new java.awt.Insets(10, 100, 10, 100)));
jLabel1.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
jLabel1.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
m_jPanelLogin.add(jLabel1, java.awt.BorderLayout.CENTER);
m_jLogonContainer.setLayout(new java.awt.CardLayout());
m_jLogonContainer.setPreferredSize(new java.awt.Dimension(520, 150));
m_jLogonPassword.setLayout(new java.awt.BorderLayout());
m_jLogonPassword.setBackground(new java.awt.Color(153, 204, 255));
m_jLogonPassword.setBorder(new javax.swing.border.EmptyBorder(new java.awt.Insets(5, 5, 5, 5)));
jPanel4.setLayout(null);
jPanel4.setBackground(new java.awt.Color(153, 204, 255));
jPanel4.setPreferredSize(new java.awt.Dimension(400, 100));
m_jCurrentUser.setText("jLabel2");
jPanel4.add(m_jCurrentUser);
m_jCurrentUser.setBounds(140, 0, 200, 50);
m_jCurrentPassword.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
m_jCurrentPasswordActionPerformed(evt);
}
});
jPanel4.add(m_jCurrentPassword);
m_jCurrentPassword.setBounds(140, 50, 200, 20);
jLabel2.setText(AppLocal.getIntString("Label.Password"));
jPanel4.add(jLabel2);
jLabel2.setBounds(10, 50, 120, 16);
m_jLogonPassword.add(jPanel4, java.awt.BorderLayout.CENTER);
jPanel7.setLayout(new java.awt.BorderLayout());
jPanel7.setBackground(new java.awt.Color(153, 204, 255));
jPanel7.setBorder(new javax.swing.border.EmptyBorder(new java.awt.Insets(0, 5, 0, 0)));
jPanel1.setLayout(new java.awt.GridLayout(0, 1, 5, 5));
jPanel1.setBackground(new java.awt.Color(153, 204, 255));
m_jPasswordOK.setIcon(new javax.swing.ImageIcon(getClass().getResource("/net/adrianromero/tpv/images/button_ok.png")));
m_jPasswordOK.setText(AppLocal.getIntString("Button.OK"));
m_jPasswordOK.setFocusPainted(false);
m_jPasswordOK.setFocusable(false);
m_jPasswordOK.setRequestFocusEnabled(false);
m_jPasswordOK.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
m_jPasswordOKActionPerformed(evt);
}
});
jPanel1.add(m_jPasswordOK);
m_jPasswordCancel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/net/adrianromero/tpv/images/button_cancel.png")));
m_jPasswordCancel.setText(AppLocal.getIntString("Button.Cancel"));
m_jPasswordCancel.setFocusPainted(false);
m_jPasswordCancel.setFocusable(false);
m_jPasswordCancel.setRequestFocusEnabled(false);
m_jPasswordCancel.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
m_jPasswordCancelActionPerformed(evt);
}
});
jPanel1.add(m_jPasswordCancel);
jPanel7.add(jPanel1, java.awt.BorderLayout.NORTH);
m_jLogonPassword.add(jPanel7, java.awt.BorderLayout.EAST);
m_jLogonContainer.add(m_jLogonPassword, "logonpassword");
m_jLogonName.setLayout(new java.awt.BorderLayout());
m_jLogonName.setBackground(new java.awt.Color(153, 204, 255));
m_jLogonName.setBorder(new javax.swing.border.EmptyBorder(new java.awt.Insets(5, 5, 5, 5)));
jPanel3.setLayout(new java.awt.BorderLayout());
m_jPeople.setLayout(new java.awt.GridLayout(0, 3, 5, 5));
m_jPeople.setBorder(new javax.swing.border.EmptyBorder(new java.awt.Insets(5, 5, 5, 5)));
jPanel3.add(m_jPeople, java.awt.BorderLayout.WEST);
jScrollPane1.setViewportView(jPanel3);
m_jLogonName.add(jScrollPane1, java.awt.BorderLayout.CENTER);
jPanel2.setLayout(new java.awt.BorderLayout());
jPanel2.setBackground(new java.awt.Color(153, 204, 255));
jPanel2.setBorder(new javax.swing.border.EmptyBorder(new java.awt.Insets(0, 5, 0, 0)));
jPanel8.setLayout(new java.awt.GridLayout(0, 1, 5, 5));
m_jClose.setIcon(new javax.swing.ImageIcon(getClass().getResource("/net/adrianromero/tpv/images/exit.png")));
m_jClose.setText(AppLocal.getIntString("Button.Close"));
m_jClose.setFocusPainted(false);
m_jClose.setFocusable(false);
m_jClose.setRequestFocusEnabled(false);
jPanel8.add(m_jClose);
jPanel2.add(jPanel8, java.awt.BorderLayout.NORTH);
m_jLogonName.add(jPanel2, java.awt.BorderLayout.EAST);
m_jLogonContainer.add(m_jLogonName, "logonname");
jPanel9.add(m_jLogonContainer);
m_jPanelLogin.add(jPanel9, java.awt.BorderLayout.SOUTH);
m_jPanelContainer.add(m_jPanelLogin, "login");
getContentPane().add(m_jPanelContainer, java.awt.BorderLayout.CENTER);
}//GEN-END:initComponents
private void m_jCurrentPasswordActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_m_jCurrentPasswordActionPerformed
// TODO add your handling code here:
tryLogon();
}//GEN-LAST:event_m_jCurrentPasswordActionPerformed
private void m_jPasswordCancelActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_m_jPasswordCancelActionPerformed
// TODO add your handling code here:
if (m_AppUserLogging != null) {
m_AppUserLogging = null;
showLogonView("logonname");
}
}//GEN-LAST:event_m_jPasswordCancelActionPerformed
private void m_jPasswordOKActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_m_jPasswordOKActionPerformed
// TODO add your handling code here:
tryLogon();
}//GEN-LAST:event_m_jPasswordOKActionPerformed
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JPanel jPanel1;
private javax.swing.JPanel jPanel2;
private javax.swing.JPanel jPanel3;
private javax.swing.JPanel jPanel4;
private javax.swing.JPanel jPanel7;
private javax.swing.JPanel jPanel8;
private javax.swing.JPanel jPanel9;
private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JButton m_jClose;
private javax.swing.JPasswordField m_jCurrentPassword;
private javax.swing.JLabel m_jCurrentUser;
private javax.swing.JLabel m_jHost;
private javax.swing.JLabel m_jIsDisplay;
private javax.swing.JLabel m_jIsPrinter;
private javax.swing.JLabel m_jLblTitle;
private javax.swing.JPanel m_jLogonContainer;
private javax.swing.JPanel m_jLogonName;
private javax.swing.JPanel m_jLogonPassword;
private javax.swing.JPanel m_jPanelContainer;
private javax.swing.JPanel m_jPanelDown;
private javax.swing.JPanel m_jPanelLogin;
private javax.swing.JPanel m_jPanelTitle;
private javax.swing.JButton m_jPasswordCancel;
private javax.swing.JButton m_jPasswordOK;
private javax.swing.JPanel m_jPeople;
private javax.swing.JLabel m_jUser;
// End of variables declaration//GEN-END:variables
}