Forums Login/signup

problem with ActionListener of jTextField

+Pie Number of slices to send: Send
Hello,
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));
awbnumber.setColumns(6);
awbnumber.addActionListener(this);
}
return awbnumber;
}
//part of the actionPerformed method
public void actionPerformed(ActionEvent e)
{
if (e.getSource() == awbnumber)
{
if (awbnumber.getText()!=null)
if(awbnumber.getText().compareTo("")!=0)
{
awbObj.setAwbnumber(awbnumber.getText());
}
else
awbObj.resetAwbnumber();
}
....
if someone can find the problem i will appreciate it very much
the code doesn't work... never calls the actionPerformed() method...
10x ahead,
netanel
+Pie Number of slices to send: Send
+Pie Number of slices to send: Send
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...
+Pie Number of slices to send: Send
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
}
+Pie Number of slices to send: Send
 

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.

reply
reply
This thread has been viewed 1389 times.
Similar Threads
can not find methods
Button and Keyboard linking
Problem with keystrokes and JOptionPane
Anonymous Inner class extends/implements
I want to handle an array of JTextFields to insert in to a TextArea when a given button is pushed.
More...

All times above are in ranch (not your local) time.
The current ranch time is
Jun 30, 2025 11:39:34.