wood burning stoves 2.0*
The moose likes IDEs, Version Control and other tools and the fly likes Button Action Event Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Reply locked New topic
Author

Button Action Event

anu johncy
Greenhorn

Joined: Dec 05, 2011
Posts: 11
hai,

I create one login page , the button event is not taking , the code is following


package login;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import database.DataBaseConnection;
import design.LoginFrame;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import java.sql.Connection;
import java.sql.DriverManager;

//Login User -- Check Login is correct or Not
class loginSubclass extends JFrame //implements ActionListener
{
String name,password;

public loginSubclass()
{

System.out.println("Inside login subclass");
design.LoginFrame frame=new design.LoginFrame();
name=frame.txtName.getText();
password=frame.txtPass.getText();

System.out.println("Name "+name);
System.out.println("Password "+password);
frame.btnLogin.setActionCommand("login");

frame.btnLogin.addActionListener(new ActionListener() {

public void actionPerformed(ActionEvent e)
{
//Execute when button is pressed
System.out.println("You clicked the button,,,,,,,,,");
}
});



}


}



public class LoginUser {


public static void main(String[] args) {

try {
System.out.println("Login user");
loginSubclass login=new loginSubclass();
design.LoginFrame LF=new design.LoginFrame();
LF.setVisible(true);
//LF.initGUI();


}
catch(Exception e)
{
JOptionPane.showMessageDialog(null,e.getMessage());
System.out.println(e);

}
}


}

help me please

regards

Anu
Mohamed Sanaulla
Saloon Keeper

Joined: Sep 08, 2007
Posts: 3071
    
  33

Please CarefullyChooseOneForum.
Lets continue the discussion here.


Mohamed Sanaulla | My Blog
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Button Action Event