Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Displaying HTML page with images from ZIP?

Reply
Thread Tools

Displaying HTML page with images from ZIP?

 
 
Cruithne3753
Guest
Posts: n/a
 
      02-06-2008
I'm doing something where I've got optional resource modules packaged in
ZIP files, this includes an information page in HTML. I can use
JTextPane to display the text, but cannot see how to get it to display
its images.

Any ideas?

Cheers,

Matt
 
Reply With Quote
 
 
 
 
Andrew Thompson
Guest
Posts: n/a
 
      02-07-2008
On Feb 7, 9:46*am, Cruithne3753
<cruithneThirtySevenFiftyTh...@blueyonder.co.uk> wrote:
> I'm doing something where I've got optional resource modules packaged in
> ZIP files, *this includes an information page in HTML. *I can use
> JTextPane to display the text, but cannot see how to get it to display
> its images.


It is relatively easy to do. Simply ensure that
all resource in the HTML are referenced with
relative paths, then include the resources in the
same ZIP file. If JEditorPane can find the HTML,
it should be able to find stylesheets and images
etc.

> Any ideas?


Post an (short) example HTML that is failing,
a description or listing of the ZIP content
that shows the HTML and the resource, and an
SSCCE* (should take no more than 20 lines of
code).

Actually, I doubt the problem here is code,
so the last might not be needed.

* <http://www.physci.org/codes/sscce.html>

--
Andrew T.
PhySci.org
 
Reply With Quote
 
 
 
 
Andrew Thompson
Guest
Posts: n/a
 
      02-07-2008
On Feb 7, 9:46*am, Cruithne3753
<cruithneThirtySevenFiftyTh...@blueyonder.co.uk> wrote:
> I'm doing something where I've got optional resource modules packaged in
> ZIP files, *this includes an information page in HTML. *I can use
> JTextPane ...


I was skimming and thought you wrote
JEditorPane there - it is far better
for HTML.

--
Andrew T.
PhySci.org
 
Reply With Quote
 
Roedy Green
Guest
Posts: n/a
 
      02-11-2008
On Wed, 06 Feb 2008 23:46:01 GMT, Cruithne3753
<> wrote, quoted or
indirectly quoted someone who said :

>I'm doing something where I've got optional resource modules packaged in
>ZIP files, this includes an information page in HTML. I can use
>JTextPane to display the text, but cannot see how to get it to display
>its images.


The images inside jars are called "resources". You find the
corresponding URL with getResource. From there you can load the
images in the usual way.

For details see http://mindprod.com/jgloss/image.html
http://mindprod.com/jgloss/resource.html
--

Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Displaying HTML page with images from ZIP? Cruithne3753 Java 3 02-12-2008 01:38 AM
Displaying Images From An SQL Database in a WEb Page Just Me ASP .Net 2 09-04-2007 04:52 PM
Displaying Images on a page hplayer03 ASP .Net 1 08-14-2007 07:45 PM
Message not displaying GIF images of attached HTML file Knack Firefox 1 11-01-2006 01:34 AM
Displaying Images from a Web page Slaphead HTML 6 09-11-2004 10:45 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57