This week's book giveaway is in the General Computing forum.
We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes java.lang.ClassCastException Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » Swing / AWT / SWT
Reply Bookmark "java.lang.ClassCastException" Watch "java.lang.ClassCastException" New topic
Author

java.lang.ClassCastException

anu johncy
Greenhorn

Joined: Dec 05, 2011
Posts: 7
hi ,
i try to create simple login page using Eclipse Editor
the code is following :

EclipseClass.java

and one externel classfile having the same package that code is following :

NextPage.java

then the error is
java.lang.ClassCastException: eclipsepackage.Login cannot be cast to javax.swing.event.AncestorListener

please support me to solve problem ,
thanks ,

[Edit - added code tags - MB]
John Jai
Bartender

Joined: May 31, 2011
Posts: 1778

The error occurs because the Login class cannot be cast to the mentioned one. Are you sure you want to add AncestorListener and not the ActionListener? Because the login class implements only the ActionListener.
Matthew Brown
Bartender

Joined: Apr 06, 2010
Posts: 3865
    
    1

And Welcome to The Ranch!
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: java.lang.ClassCastException
 
Similar Threads
Implementing scanner into a simple login page
Sending password/login info using sockets
jmenubar,menuitem
How to refresh View in MVC architecture.
Boolean problem