Click to See Complete Forum and Search --> : cannot resolve symbol, ExitListener()


ziul
07-19-2007, 11:01 AM
I don't understand this, I've been working on a few examples, all the code appears fine, except on every compile, I get an error on the ExitListener() method, here's my code:

import javax.swing.*;

public class HelloWorld {
public static void main(String[] args) {
//JLabel is used to create text and icon labels to display small amounts of information
JFrame frame = new JFrame("Hellow World");
final JLabel label = new JLabel("Hello World!");
frame.getContentPane().add(label);
frame.pack();
frame.addWindowListener(new ExitListener());
frame.setVisible(true);
}
}

Here's the error:

1 error

C:\javacode\Notepad>javac HelloWorld.java
HelloWorld.java:10: cannot resolve symbol
symbol : class ExitListener
location: class HelloWorld
frame.addWindowListener(new ExitListener());
^
1 error

Any help with this confusion would be great.

Khalid Ali
07-20-2007, 12:24 AM
it only means that class ExitListener is not found in your applications path. Make sure that you have it.

ziul
07-20-2007, 03:21 AM
I downloaded the latest java software. I don't understand.

jasonahoule
07-20-2007, 03:33 AM
I don't believe there is an ExitListener class. There is an EventListener. You should probably extend the EventListener class to implement your ExitListener.