Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

very basic HTML java editor

0 views
Skip to first unread message

onetitfemme

unread,
Sep 20, 2006, 7:41:31 AM9/20/06
to
hi,
.
I need some intro code to a very basic HTML java editor, that would
allow only italics, bold, lists ... but users are not supposed to do
any scripting, just highlight and click on "italics", "bold, "lists"
...
.
if users shouldn't enter the "<" or ">" key. So I know they didn't use
the editor to send malicious scripts to other people (I will
doublecheck on the back end anyway ;-))
.
The code examples I have found are bloated and framed by the
particular developer's mind. I just need something very basic and
probably build on top of it a little bit
.
Any ideas, leads, etc?
.
Thank you
onetitfemme

onetitfemme

unread,
Sep 23, 2006, 9:17:22 PM9/23/06
to
I found demo code with pretty much what I was looking for in the
excelent book "Swing" by Matthew Robinson and Pavel Vorobiev. 2003 |
912 pages | ISBN: 193011088X
.
code examples you can get from http://www.manning.com/robinson2/
.
I was trying to enter some basic Math scripts such as
<math>2^{4^{n}}</math>, but the HTMLWordProcessor didn't swallow them.
I also tried to enter non-ASCII characters (actually simplified
CHinese) using box IE and FIreFox and got weird characters and little
boxes.
.
I then went "to the source" ;-) Tools -> HTML Source and forcibly
tried to reset the HTML heading as something like:
.
!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<!-- Theme design by xoopsdesign.com http://www.xoopsdesign.com -->
<meta http-equiv="content-type" content="text/html; charset=gb2312" />
.
as it is the case in the page but got:
.
javax.swing.text.ChangedCharSetException
at
javax.swing.text.html.parser.DocumentParser.handleEmptyTag(DocumentParser.java:169)
at javax.swing.text.html.parser.Parser.startTag(Parser.java:372)
at javax.swing.text.html.parser.Parser.parseTag(Parser.java:1846)
at javax.swing.text.html.parser.Parser.parseContent(Parser.java:1881)
at javax.swing.text.html.parser.Parser.parse(Parser.java:2047)
at
javax.swing.text.html.parser.DocumentParser.parse(DocumentParser.java:106)
at
javax.swing.text.html.parser.ParserDelegator.parse(ParserDelegator.java:78)
at javax.swing.text.html.HTMLEditorKit.read(HTMLEditorKit.java:230)
at HtmlProcessor$27.actionPerformed(HtmlProcessor.java:569)
at
javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1786)
at
javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButton.java:1839)
at
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
at
javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
at javax.swing.AbstractButton.doClick(AbstractButton.java:289)
at
javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1113)
at
javax.swing.plaf.basic.BasicMenuItemUI$MouseInputHandler.mouseReleased(BasicMenuItemUI.java:943)
at java.awt.Component.processMouseEvent(Component.java:5100)
at java.awt.Component.processEvent(Component.java:4897)
at java.awt.Container.processEvent(Container.java:1569)
at java.awt.Component.dispatchEventImpl(Component.java:3615)
at java.awt.Container.dispatchEventImpl(Container.java:1627)
at java.awt.Component.dispatchEvent(Component.java:3477)
at
java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3483)
at
java.awt.LightweightDispatcher.processMouseEvent(Container.java:3198)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3128)
at java.awt.Container.dispatchEventImpl(Container.java:1613)
at java.awt.Window.dispatchEventImpl(Window.java:1606)
at java.awt.Component.dispatchEvent(Component.java:3477)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:480)
at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:201)
at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)
at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)

onetitfemme

unread,
Sep 24, 2006, 9:38:50 AM9/24/06
to
you can find examples of various math HTMl examples here:
.
http://www.mozilla.org/projects/mathml/demo/basics.xhtml
.
otf

0 new messages