Package voxo.client.listeners

Source Code of voxo.client.listeners.ButtonLoginListener

package voxo.client.listeners;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JFrame;

import voxo.client.actions.LoginAction;
import voxo.client.controllers.ClientController;
import voxo.client.views.MainView;
import voxo.common.packets.LoginPacket;

public class ButtonLoginListener implements ActionListener {

  private JFrame        j;
  private ClientController  c;

  public ButtonLoginListener(ClientController c, JFrame j) {
    this.j = j;
  }

  @Override
  public void actionPerformed(ActionEvent e) {
    MainView view = (MainView) j;
    String username = view.getUsernameField().getText();
    char[] pwdArray = view.getPasswordField().getPassword();
    String pwd = new String(pwdArray);
    // this.p = new LoginPacket();
    new LoginAction(c, new LoginPacket(username, pwd));
  }

}
TOP

Related Classes of voxo.client.listeners.ButtonLoginListener

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.