Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / GUI / January 2004

Tip: Looking for answers? Try searching our database.

JEditorPane: Enhancing...

Thread view: 
RancidButtChutney - 22 Jan 2004 20:49 GMT
Heya.

Does anyone know of an example of a subclassed JEditorPane?
I'd like to see if I can expand it to support inlined applets, amongst
other things.

Any feedback would be greatly appreciated.
Alex Hunsley - 23 Jan 2004 00:05 GMT
> Heya.
>
[quoted text clipped - 3 lines]
>
> Any feedback would be greatly appreciated.

Look on google groups for posts about JEditorPane: it's horrible,
really, so beware the horrors. I used calpa html pane for rendering html
once, no idea if it did applets...
Andrew Thompson - 23 Jan 2004 01:16 GMT
"Alex Hunsley"
...
| > Does anyone know of an example of a subclassed JEditorPane?
| > I'd like to see if I can expand it to support inlined applets, amongst
| > other things.
...
| Look on google groups for posts about JEditorPane: it's horrible,
| really, so beware the horrors.

Agree completely.
You will find some horror stories.
I use JEditorPanes currently for
displaying simple html over which I
have complete control.  But they are
not good for much else.

The chances of getting it to support
Java applets I would estimate at
somewhere between 'nil' and 'buckleys'..

Either look into Alex' suggestion*, or try
BrowserLauncher - to get the applet loaded
in the users default browser - IE, Mozilla whatever..

* I am not familiar with the 'calpa html pane'
he mentioned.

--
Andrew Thompson
* http://www.PhySci.org/ PhySci software suite
* http://www.1point1C.org/ 1.1C - Superluminal!
* http://www.AThompson.info/andrew/ personal site
Martin Borg - 25 Jan 2004 19:38 GMT
> Agree completely.
> You will find some horror stories.
> I use JEditorPanes currently for
> displaying simple html over which I
> have complete control.  But they are
> not good for much else.

I also use JEditorPane for displaying html. It really limits the HTML
that can be used. Is there any free alternative to JEditorPane for
showing HTML-content inside a Swing-application ?
Albert Finchly - 26 Jan 2004 08:18 GMT
> I also use JEditorPane for displaying html. It really limits the HTML
> that can be used. Is there any free alternative to JEditorPane for
> showing HTML-content inside a Swing-application ?

CalPane is free-ish.  Well, free to use with some restrictions.  It looks
like
a decent package, but doesn't support editing. :-(

http://htmlbrowser.sourceforge.net/
Anders - 26 Jan 2004 13:56 GMT
 > CalPane is free-ish.  Well, free to use with some restrictions.  It
looks
> like
> a decent package, but doesn't support editing. :-(
>
> http://htmlbrowser.sourceforge.net/

Great, looks like what I have been looking for! I read the description
of functionality and the only thing I really miss is stylesheets.

Have they done a good job on the <TABLE> tag ? Does it behave like IE or
Netscape ? How about <FORM> with POST ? I guess javascript won't work to
check input ? It would be really nice to be able to load a webpage for
feedback and bugreports in a Swing-application.
Andrew Thompson - 26 Jan 2004 17:00 GMT
|   > CalPane is free-ish.  Well, free to use with some restrictions.  It

|...It would be really nice to be able to load a webpage for
| feedback and bugreports in a Swing-application.

_From_ a Swing appl. is easy. BrowserLauncher

--
Andrew Thompson
* http://www.PhySci.org/ PhySci software suite
* http://www.1point1C.org/ 1.1C - Superluminal!
* http://www.AThompson.info/andrew/ personal site
Christian Kaufhold - 26 Jan 2004 17:39 GMT
>> Agree completely.
>> You will find some horror stories.
[quoted text clipped - 5 lines]
> I also use JEditorPane for displaying html. It really limits the HTML
> that can be used. Is there any free alternative to JEditorPane for

Really? What limitations are there?

Christian
Signature

And in short, I was afraid.

Andrew Thompson - 26 Jan 2004 17:56 GMT
| >> Agree completely.
| >> You will find some horror stories.
[quoted text clipped - 7 lines]
|
| Really? What limitations are there?

I heard ..not sure who mentioned it..
JEP's had trouble handling tags of the form..

<p />The Paragraph</p />

(I am not even sure that _is_ correct
notation, but IE and Moz both read it
as a paragraph...)

--
Andrew Thompson
* http://www.PhySci.org/ PhySci software suite
* http://www.1point1C.org/ 1.1C - Superluminal!
* http://www.AThompson.info/andrew/ personal site
Christian Kaufhold - 26 Jan 2004 19:14 GMT
> | >> Agree completely.
> | >> You will find some horror stories.
[quoted text clipped - 16 lines]
> notation, but IE and Moz both read it
> as a paragraph...)

1. This concerns only the HTML parser, not JEditorPane at all.
You can plug in your own parser.

2. If you mean the XML *empty*-element notation (in your example
<p /> would mean <p></p> and </p /> is meaningless), e.g.

<img src="XXX" alt="YYY" />

this actually means something different in HTML (considered as an
SGML application and not tag-soup). IMO the Swing HTML parser is
correct here in parsing this as with a literal ">" at the end.

See

http://groups.google.com/groups?selm=39911fe6.3208216801%40news.cs.hut.fi  

If you want XHTML, use a custom XHTML parser.

Christian
Signature

And in short, I was afraid.

Andrew Thompson - 26 Jan 2004 20:05 GMT
"Christian Kaufhold" ...
..
| > <p />The Paragraph</p />
...
| 1. This concerns only the HTML parser, not JEditorPane at all.
| You can plug in your own parser.

Right  (as in ...'OK, I got it now' rather
than 'I knew that all along')

| 2. If you mean the XML *empty*-element notation

Yep, that is what I was thinking of..

[ As opposed to the fragment I writ,
which just happened to be understandable
by both browsers. ]

--
Andrew Thompson
* http://www.PhySci.org/ PhySci software suite
* http://www.1point1C.org/ 1.1C - Superluminal!
* http://www.AThompson.info/andrew/ personal site
Chris Smith - 27 Jan 2004 03:10 GMT
> 1. This concerns only the HTML parser, not JEditorPane at all.
> You can plug in your own parser.

[...]

> If you want XHTML, use a custom XHTML parser.

Okay, so I'm curious.  Do you mean that you think it's possible to
purchase (or find) an editor kit for the full HTML 4 or XHTML standards?  
Or do you simply mean that someone desiring these things should write
them?

I'm *very* interested here, because:

1. I've spent a good bit of time over the last two years writing and
maintaining some extensions to javax.swing.text.html.HTMLEditorKit for
an HTML editing component of a web-based training application sold by
MindIQ.

2. I am seriously considering the possibility that I will be writing an
editor kit from scratch to support full HTML 4 and XHTML in the near
future.

3. It is generally planned that when I do so, we will release the code
under an open-source license.

If such a beast already exists, and especially if such a beast (even in
an incomplete form) is already available under BSD-style or LGPL open-
source licensing, then this would make my life much easier... or at
least provide more options to consider before embarking on the task
myself.

Signature

www.designacourse.com
The Easiest Way to Train Anyone... Anywhere.

Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation

Christian Kaufhold - 28 Jan 2004 20:06 GMT
>> 1. This concerns only the HTML parser, not JEditorPane at all.
>> You can plug in your own parser.
[quoted text clipped - 7 lines]
> Or do you simply mean that someone desiring these things should write
> them?

Neither.

I was just talking about parsing here. Using a custom XHTML parser to
build a HTMLDocument should not be too difficult.

For most new XHTML/HTML4 elements, adding support at the usual leve
(both for storage and displaying) is easy.

Christian


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.