File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Swing / AWT / SWT and the fly likes problem with ActionListener of jTextField 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 » Java » Swing / AWT / SWT
Bookmark "problem with ActionListener of jTextField" Watch "problem with ActionListener of jTextField" New topic

problem with ActionListener of jTextField

netanel weinberg

Joined: May 10, 2004
Posts: 27
i've written some code in my webapp but i've got a problem with the ActionListener of the jTextfields components? here is some of my code:
//method fo awbnumber
private javax.swing.JTextField getAwbnumber() {
if(awbnumber == null) {
awbnumber = new javax.swing.JTextField();
awbnumber.setPreferredSize(new java.awt.Dimension(100,25));
return awbnumber;
//part of the actionPerformed method
public void actionPerformed(ActionEvent e)
if (e.getSource() == awbnumber)
if (awbnumber.getText()!=null)
if someone can find the problem i will appreciate it very much
the code doesn't work... never calls the actionPerformed() method...
10x ahead,
Craig Wood
Ranch Hand

Joined: Jan 14, 2004
Posts: 1535
netanel weinberg

Joined: May 10, 2004
Posts: 27
you haven't solved my problem... i want the change in the jTextfield field
will call the actionperfomed method and i can't do that...
Lalit Kumar

Joined: Jan 29, 2004
Posts: 2
it seems that u r implementing the "ActionListener" interface.

Add the line "implements ActionListener" at your start of program.

class XYZ implements ActionListener
//Code of particular class
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15302

Originally posted by netanel weinberg:
you haven't solved my problem...

First of all, we're not here to "solve your problem". We are here to help you solve your problem.

Secondly, i've written some code in my webapp...

A webapp? And you are using Swing?

Thirdly, since this is a Swing question, I am going to move it to the appropriate forum, um, the Swing forum. Yeah, that one sounds close to what you are working with.

GenRocket - Experts at Building Test Data
I agree. Here's the link:
subject: problem with ActionListener of jTextField
It's not a secret anymore!