Results 1 to 5 of 5
- 09-24-2008, 10:23 PM #1
Member
- Join Date
- Sep 2008
- Posts
- 42
- Rep Power
- 0
How to make Java see a string as html
Hi all,
this is my first post on the forum.
I haven't actually started using Java yet, but went on a course a couple of weeks ago to start learning.
A colleague of mine is having a bit of a problem with a pdf writer program he managed to find.
He is implementing it in a WIKI that he is creating, and is having trouble making the pdfwrite see a string as html.
it is creating the pdf as html code, NOT the 'results' of the code - if that makes sense.
has anyone on here successfully implemented a pdf writer using Java. Or anything that takes html code and displays is as it should be.
Thanks in advance,
Matt
- 09-25-2008, 12:04 AM #2
There is an HTMLEditorKit that will format HTML when it is displayed in a JEditorPane.
- 09-25-2008, 09:57 AM #3
Member
- Join Date
- Sep 2008
- Posts
- 42
- Rep Power
- 0
Thanks Norm.
do you have any links for this kit and how to implement it?
- 09-25-2008, 04:05 PM #4
Its part of the JDK. I don't have any sample code, use a Search for it.
I think the JEditorPane will look at added text and figure out what editor kit to use from that.
- 09-26-2008, 03:40 AM #5
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
On JEditorPane you have to do few things first. Set the editor kit using setEditorKit() first, in that case you can use HTMLEditorKit. Then set the sontent type. To ge the content use getText(), and it return the content as a string of the JEditorPane.
Similar Threads
-
Error: cannot resolve symbol' on Person (java.lang.String, java.lang.String)
By baltimore in forum New To JavaReplies: 2Last Post: 09-18-2008, 07:30 AM -
how do i make a string return a number?
By pjr5043 in forum New To JavaReplies: 6Last Post: 09-15-2008, 04:56 AM -
Is it possible to make this in Java? Challenging question.
By matt_well in forum New To JavaReplies: 24Last Post: 07-29-2008, 04:04 PM -
Using java.util.Scanner to search for a String in a String
By Java Tip in forum Java TipReplies: 0Last Post: 11-20-2007, 04:59 PM -
make a variable name from a string?
By Kinnikinnick in forum New To JavaReplies: 3Last Post: 11-13-2007, 03:54 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks