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


#1

Hi devs,

I tried to launch an applet which is in a jar library from a click on a
JButton.
So I did put the .jar with my applet.class and all the dependancies in the
lib/installer-exclude/ directory.

In my actionPerformed(ActionEvent e) method, i make a call to the applet by
creating a new instance of it : JMyApplet ap = new JMyApplet();
I even set it visible with the setVisible(true) method but nothing is
launched.
Whereas is a make a new instance of the JDialog of the exampleplugin, i've
got the window.

Of course, I added : <zipfileset src="${lib.noinst}/JMySpell.jar"
prefix=""/> into the target tags.

Have u any idea of what could cause the problem ?

Jean-Daniel


#2

Hello Jean-Daniel,

This looks strange indeed. I suspect that the JMySpell.jar might be using packages that are either not imported by your manifest or are not exported by any of the other bundles.

In either case it would be easier to tell what's going on if you could send over the output of the error/exception that you are getting when clicking on the button.

Cheers
Emil

francky vincent wrote:

···

Hi devs,

I tried to launch an applet which is in a jar library from a click on a JButton.
So I did put the .jar with my applet.class and all the dependancies in the lib/installer-exclude/ directory.

In my actionPerformed(ActionEvent e) method, i make a call to the applet by creating a new instance of it : JMyApplet ap = new JMyApplet();
I even set it visible with the setVisible(true) method but nothing is launched.
Whereas is a make a new instance of the JDialog of the exampleplugin, i've got the window.

Of course, I added : <zipfileset src="${lib.noinst}/JMySpell.jar" prefix=""/> into the target tags.

Have u any idea of what could cause the problem ?

Jean-Daniel

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


#3

The problem is that I had no error/exception message when clicking on the
button.
After I tried to use the method init() from the JMyApplet class and now it
launches a dialog window with just error on it and no message in the console
which could be more explicit.

···

2007/5/9, Emil Ivov <emcho@emcho.com>:

Hello Jean-Daniel,

This looks strange indeed. I suspect that the JMySpell.jar might be
using packages that are either not imported by your manifest or are not
exported by any of the other bundles.

In either case it would be easier to tell what's going on if you could
send over the output of the error/exception that you are getting when
clicking on the button.

Cheers
Emil

francky vincent wrote:
> Hi devs,
>
> I tried to launch an applet which is in a jar library from a click on a
> JButton.
> So I did put the .jar with my applet.class and all the dependancies in
> the lib/installer-exclude/ directory.
>
> In my actionPerformed(ActionEvent e) method, i make a call to the
> applet by creating a new instance of it : JMyApplet ap = new
JMyApplet();
> I even set it visible with the setVisible(true) method but nothing is
> launched.
> Whereas is a make a new instance of the JDialog of the exampleplugin,
> i've got the window.
>
> Of course, I added : <zipfileset src="${lib.noinst}/JMySpell.jar"
> prefix=""/> into the target tags.
>
> Have u any idea of what could cause the problem ?
>
> Jean-Daniel

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


#4

Is your use of S-C as an applet in a Web browser's VM now working? SIP
works? To which SIP server? IM works? Any special exceptions/failures
not reported with the application instance?

···

On Wed, 2007-05-09 at 16:47 +0200, JD wrote:

The problem is that I had no error/exception message when clicking on
the button.
After I tried to use the method init() from the JMyApplet class and
now it launches a dialog window with just error on it and no message
in the console which could be more explicit.

2007/5/9, Emil Ivov <emcho@emcho.com>:
        Hello Jean-Daniel,
        
        This looks strange indeed. I suspect that the JMySpell.jar
        might be
        using packages that are either not imported by your manifest
        or are not
        exported by any of the other bundles.
        
        In either case it would be easier to tell what's going on if
        you could
        send over the output of the error/exception that you are
        getting when
        clicking on the button.
        
        Cheers
        Emil
        
        francky vincent wrote:
        > Hi devs,
        >
        > I tried to launch an applet which is in a jar library from a
        click on a
        > JButton.
        > So I did put the .jar with my applet.class and all the
        dependancies in
        > the lib/installer-exclude/ directory.
        >
        > In my actionPerformed(ActionEvent e) method, i make a call
        to the
        > applet by creating a new instance of it : JMyApplet ap = new
        JMyApplet();
        > I even set it visible with the setVisible(true) method but
        nothing is
        > launched.
        > Whereas is a make a new instance of the JDialog of the
        exampleplugin,
        > i've got the window.
        >
        > Of course, I added : <zipfileset
        src="${lib.noinst}/JMySpell.jar"
        > prefix=""/> into the target tags.
        >
        > Have u any idea of what could cause the problem ?
        >
        > Jean-Daniel
        
        ---------------------------------------------------------------------
        To unsubscribe, e-mail:
        dev-unsubscribe@sip-communicator.dev.java.net
        For additional commands, e-mail:
        dev-help@sip-communicator.dev.java.net
        

--

(C) Matthew Rubenstein

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


#5

This is really weird, (I mean the fact that you don't see an exception on the console) try looking again as given the huge amounts of logs that SC spits during a debug session it would be easy to miss it.

Apart from that you could also add some trace println calls in the method that is supposed to show the applet window (including after the setVisible() and init calls) then try to look them all up in the logs. If one of them is missing then you could more easily determine where the exception is being thrown (and it would probably also help you to find the stack trace).

Cheers
Emil

JD wrote:

···

The problem is that I had no error/exception message when clicking on the button.
After I tried to use the method init() from the JMyApplet class and now it launches a dialog window with just error on it and no message in the console which could be more explicit.

2007/5/9, Emil Ivov <emcho@emcho.com <mailto:emcho@emcho.com>>:

    Hello Jean-Daniel,

    This looks strange indeed. I suspect that the JMySpell.jar might be
    using packages that are either not imported by your manifest or are not
    exported by any of the other bundles.

    In either case it would be easier to tell what's going on if you could
    send over the output of the error/exception that you are getting when
    clicking on the button.

    Cheers
    Emil

    francky vincent wrote:
     > Hi devs,
     >
     > I tried to launch an applet which is in a jar library from a
    click on a
     > JButton.
     > So I did put the .jar with my applet.class and all the
    dependancies in
     > the lib/installer-exclude/ directory.
     >
     > In my actionPerformed(ActionEvent e) method, i make a call to the
     > applet by creating a new instance of it : JMyApplet ap = new
    JMyApplet();
     > I even set it visible with the setVisible(true) method but
    nothing is
     > launched.
     > Whereas is a make a new instance of the JDialog of the
    exampleplugin,
     > i've got the window.
     >
     > Of course, I added : <zipfileset src="${lib.noinst}/JMySpell.jar"
     > prefix=""/> into the target tags.
     >
     > Have u any idea of what could cause the problem ?
     >
     > Jean-Daniel

    ---------------------------------------------------------------------
    To unsubscribe, e-mail:
    dev-unsubscribe@sip-communicator.dev.java.net
    <mailto:dev-unsubscribe@sip-communicator.dev.java.net>
    For additional commands, e-mail:
    dev-help@sip-communicator.dev.java.net
    <mailto: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