[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    RE: In Konqueror browser, Java applet can NOT access Image files
From:       Trace Bond <tbond () ctv ! ca>
Date:       2007-10-21 7:22:45
Message-ID: F8EBAC189452844C808799CDF8B1F7F707C52B67 () vacoms04 ! corp ! ctv ! ca
[Download RAW message or body]

Hello!
My applets and PNG image files are in a JAR file named 'CircleBook.jar' at
'www.circlebook.ca'. 
These applets and PNG image files display successfully in Microsoft IE and
Firefox, but not in Konqueror.

Below is the code that tries to extract the PNG file from the JAR file.. No
exceptions are thrown but the resulting 'l_Image' in Konqueror is of zero
size.
The JAR file is located with the HTML file which contains the tag <APPLET
code="ca/circlebook/tbProjct_CircBook/TbSuAplt_Geom.class"
archive="CircleBook.jar" etc>. Although 'a_Applet' is not located in the
JAR's root folder, 'a_Applet.getCodeBase()' below seems to refer to that
root folder in Microsoft IE and Firefox (which may be weird on their part)
because of the result of its use in 'new java.net.URL(
a_Applet.getCodeBase(), a_sImagFile)'. The String variable 'a_sImagFile'
contains the full path of the image file in the JAR's folder tree.. for
instance, it could contain "ca/circlebook/ImagFiles/Some_Imag.png". 
So a question to be asked is: under these circumstances, what does
'a_Applet.getCodeBase()' refer to in Konqueror?

      java.net.URL     l_URL;
      java.awt.Image   l_Image;
      try
      {
        l_URL=  new java.net.URL( a_Applet.getCodeBase(), a_sImagFile);
        if ( l_URL == null )
          throw( new TbException( "l_URL == null"));
        l_Image=  a_Applet.getImage( l_URL);
        if ( l_Image == null )
          throw( new TbException( "l_Image == null"));
      }
      catch (Exception a_Exception)
      {
        throw( new TbException( "java.net.URL() OR getImage(): "+
a_Exception.toString()));
      }
      // Using 'MediaTracker' as a method of completing DnLoad:
      java.awt.MediaTracker  l_MediaTracker=  new java.awt.MediaTracker(
a_Applet);
      l_MediaTracker.addImage( l_Image, 0);
      try { l_MediaTracker.waitForAll(); }
      catch( InterruptedException a_InterruptedException)
      {
        throw( new TbException( "DnLoading ImagFile: a_InterruptedException=
"+ a_InterruptedException.toString()));
      } 

Thanks,
Trace Bond

-----Original Message-----
From: koos vriezen [mailto:koos.vriezen@gmail.com] 
Sent: Friday, 05 October, 2007 10:21
To: kde-devel@kde.org
Cc: Trace Bond
Subject: Re: In Konqueror browser, Java applet can NOT access Image files
stro red in JAR file

2007/10/4, Richard Dale <rdale@foton.es>:
> On Thursday 04 October 2007 03:36:53 you wrote:
> > In Konqueror browser, Java applet can NOT access Image files stored 
> > in JAR file

That should work AFAIK. Try adding -Dkjas.debug=1 to additional java
arguments before opening the page with the applet and open the java console
after loading the page by clicking the 'Duke' icon in Konquerors status bar.
That should tell you what goes wrong hopefully

Br.
Koos
 
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic