Hi,
I have a HTML page that has some links. When I click a link, I want to display the
applet and its data differs depending upon the element selected. To achieve this, I made an HTTP call to the
servlet and passed it the element selected as parameter. Depending upon the element selected I create a swing object that I want to render on the applet. This object I pass to the applet and add this to the applet.
But this is not working. I am getting the following exception on the
Java console :
java.io.InvalidClassException: javax.swing.JComponent; local class incompatible: stream classdesc serialVersionUID = 5896976265092562486, local class serialVersionUID = 7917968344860800289
at java.io.ObjectStreamClass.initNonProxy(Unknown Source)
at java.io.ObjectInputStream.readNonProxyDesc(Unknown Source)
at java.io.ObjectInputStream.readClassDesc(Unknown Source)
at java.io.ObjectInputStream.readNonProxyDesc(Unknown Source)
at java.io.ObjectInputStream.readClassDesc(Unknown Source)
at java.io.ObjectInputStream.readNonProxyDesc(Unknown Source)
at java.io.ObjectInputStream.readClassDesc(Unknown Source)
at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
at java.io.ObjectInputStream.readObject0(Unknown Source)
at java.io.ObjectInputStream.readObject(Unknown Source)
at com.accurev.HelloWorldApplet.readInputStream(HelloWorldApplet.java:78)
at com.accurev.HelloWorldApplet.sendObject(HelloWorldApplet.java:51)
at com.accurev.HelloWorldApplet.init(HelloWorldApplet.java:28)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
java.lang.NullPointerException
at java.awt.Container.addImpl(Unknown Source)
at java.awt.Container.add(Unknown Source)
at com.accurev.HelloWorldApplet.init(HelloWorldApplet.java:31)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
------------------------------------------------------
The code that I have implemented goes like this :
The DiffPanel object extends JPanel and implements Serializable.
Can anyone please help.
Thanks
Devang Shah