File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Reply locked New topic

Button Action Event

anu johncy

Joined: Dec 05, 2011
Posts: 11

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();

System.out.println("Name "+name);
System.out.println("Password "+password);

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();

catch(Exception e)



help me please


Mohamed Sanaulla
Saloon Keeper

Joined: Sep 08, 2007
Posts: 3151

Please CarefullyChooseOneForum.
Lets continue the discussion here.

Mohamed Sanaulla | My Blog
I agree. Here's the link:
subject: Button Action Event
It's not a secret anymore!