I wrote a FChatManager - for Facebook Chat as below:
Further I have ChatBuddy class that represents User/Buddy available for chat ... I get it when I receive Presence packet .
What I wanted to do is add/remove users, along with their images (which I could get from vCard) from a List in the ChatManager as and when they become available/unavailable. The problem is, I keep getting following...
Class of value: class javax.swing.plaf.basic.BasicPanelUI
Exception in thread "AWT-EventQueue-0" java.lang.ClassCastException: javax.swing.plaf.basic.BasicPanelUI cannot be cast to ui.ChatBuddy
at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(SystemEventQueueUtilities.java:124) at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.security.AccessController.doPrivileged(Native Method)
What I don't get is I am adding a ChatBuddy at Line Number 60 in FChatManager to the List.. via ChatManager's addBuddy(ChatBuddy buddy) at Line No. 60 in ChatManager but javax.swing.plaf.basic.BasicPanelUI is what it gets... which is all the reason I think its failing. How could I get rid of this?? I don't have in depth knowledge of Java Please I need help... after so long I have zeroed to using JList to display users online and also wrote a Simple Program and adding some custom Object to List.. there it said that the object received was the one that I had added.
Thanks, Dunn. It was a silly mistake.
Just one more thing? Do you think, my design is kind of Okay?? Like doing most of the thing is an abstract class (Chat Manager)... and doing only Specific Things .. like related to Facebook in FChatManager which extends ChatManager??
Thanks a LOT.