This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
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

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
Have you checked out Aspose?
subject: Button Action Event
It's not a secret anymore!