[sip-comm-dev] Calling an applet from a jar library


#1

Hello everybody,

Using Eclipse, I can run the applet "alone" (I mean
"not included in the Sip-Communicator project") ...

Then, I made a .jar with these files (spellcheck
source code, applet and dictionnaries included)
keeping the same "tree structure" ...

Calling the applet in S-C, I don't know why JD doesn't
have an error on the NetBeans console, but in my case,
there's also an "error" appearing in the "dialog" (or
applet) launched but I can see an error message too in
the console ...

Here it is :

java.lang.NullPointerException
     [java] at
java.applet.Applet.getCodeBase(Applet.java:152)
     [java] at
org.dts.spell.examples.JMySpellApplet.getDictionary(JMySpellApplet.java:105)
     [java] at
org.dts.spell.examples.JMySpellApplet.getDictionary(JMySpellApplet.java:100)
     [java] at
org.dts.spell.examples.JMySpellApplet.init(JMySpellApplet.java:703)
     [java] at
net.java.sip.communicator.plugin.exampleplugin.ExamplePluginMenuItem.actionPerformed(ExamplePluginMenuItem.java:46)
     [java] at
javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
     [java] at
javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
     [java] at
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
     [java] at
javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
     [java] at
javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
     [java] at
java.awt.Component.processMouseEvent(Component.java:6038)
     [java] at
javax.swing.JComponent.processMouseEvent(JComponent.java:3260)
     [java] at
java.awt.Component.processEvent(Component.java:5803)
     [java] at
java.awt.Container.processEvent(Container.java:2058)
     [java] at
java.awt.Component.dispatchEventImpl(Component.java:4410)
    .
    .
    .
    etc ...

It seems to exist a problem with the getCodeBase()
method (used to return the url of the dictionary) ...

I don't understand why there's no problem (to find the
dictionary) when the applet is launched "alone" and it
doesn't work in S-C even if the tree structure is the
same !

Have you any advice ?

Thanx for the help !

Toni

···

___________________________________________________________________________
D�couvrez une nouvelle fa�on d'obtenir des r�ponses � toutes vos questions !
Profitez des connaissances, des opinions et des exp�riences des internautes sur Yahoo! Questions/R�ponses
http://fr.answers.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net


#2

Seems like a path problem.

Alternately you might want to use a JFrame instead of a JApplet. This should make things easier.

Emil

Kaizersoze10 wrote:

···

Hello everybody,

Using Eclipse, I can run the applet "alone" (I mean
"not included in the Sip-Communicator project") ...

Then, I made a .jar with these files (spellcheck
source code, applet and dictionnaries included)
keeping the same "tree structure" ...

Calling the applet in S-C, I don't know why JD doesn't
have an error on the NetBeans console, but in my case,
there's also an "error" appearing in the "dialog" (or
applet) launched but I can see an error message too in
the console ...

Here it is :

java.lang.NullPointerException
     [java] at
java.applet.Applet.getCodeBase(Applet.java:152)
     [java] at
org.dts.spell.examples.JMySpellApplet.getDictionary(JMySpellApplet.java:105)
     [java] at
org.dts.spell.examples.JMySpellApplet.getDictionary(JMySpellApplet.java:100)
     [java] at
org.dts.spell.examples.JMySpellApplet.init(JMySpellApplet.java:703)
     [java] at
net.java.sip.communicator.plugin.exampleplugin.ExamplePluginMenuItem.actionPerformed(ExamplePluginMenuItem.java:46)
     [java] at
javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
     [java] at
javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
     [java] at
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
     [java] at
javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
     [java] at
javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
     [java] at
java.awt.Component.processMouseEvent(Component.java:6038)
     [java] at
javax.swing.JComponent.processMouseEvent(JComponent.java:3260)
     [java] at
java.awt.Component.processEvent(Component.java:5803)
     [java] at
java.awt.Container.processEvent(Container.java:2058)
     [java] at
java.awt.Component.dispatchEventImpl(Component.java:4410)
    .
    etc ...

It seems to exist a problem with the getCodeBase()
method (used to return the url of the dictionary) ...

I don't understand why there's no problem (to find the
dictionary) when the applet is launched "alone" and it
doesn't work in S-C even if the tree structure is the
same !

Have you any advice ?

Thanx for the help !

Toni

      ___________________________________________________________________________ D�couvrez une nouvelle fa�on d'obtenir des r�ponses � toutes vos questions ! Profitez des connaissances, des opinions et des exp�riences des internautes sur Yahoo! Questions/R�ponses http://fr.answers.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net