swing parser issue

E

erjdriver

i'm using javax.swing.text.html.parser.ParserDelegator() to parse

the handleText() method does not get called for text-elements of white-
spaces.

for example a DOM of

SPAN
#text
<SPACE>

the handleText does not get called for the <SPACE> text element.

any way to force that.
 
J

John B. Matthews

erjdriver said:
i'm using javax.swing.text.html.parser.ParserDelegator() to parse the
handleText() method does not get called for text-elements of white-
spaces. for example a DOM of

SPAN
#text
<SPACE>

the handleText does not get called for the <SPACE> text element.
any way to force that.

I don't know, but I was intrigued to see that <SPACE> parses as a
literal space ('\u0020') and renders in JEditorPane as an editable text
field that initially contains the string "space".

JEditorPane jep = new JEditorPane(
"text/html", "<html><body><SPACE></body></html>");
JFrame f = new JFrame();
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.add(jep);
f.pack();
f.setLocationRelativeTo(null);
f.setVisible(true);

|------\
| space |
|------/

I did not expect that.

I see that "<SPACE>" is not a javax.swing.text.html.HTML.Tag:

<http://download-llnw.oracle.com/javase/6/docs/api/javax/swing/text/html/
HTML.Tag.html>

Perhaps it's a feature?
 
Joined
Sep 10, 2010
Messages
1
Reaction score
0
Debt Counseling

The system catches up, and we find ourselves in debt. As a result we end up having multiple credit card accounts opened all at one time, multiple bills to pay each month, but only one income to handle it all. This income has to spread itself so thin there isn't enough to go around. This could lead to high stress levels, marital tension, creditor harassment or even bankruptcy.
=====================
Debt Counseling
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,773
Messages
2,569,594
Members
45,125
Latest member
VinayKumar Nevatia_
Top