Skip to main content
gamedev.net
🔒 Locked

[java] HTML in Java

Started by Lando Jan 9, 2003 at 2:17 PM 1 replies 200+ views
Original Post
Lando
Lando
Hello, I''m making a chat program in java and i want to be able to enter in html tags that will be displayed will be displayed with the message. So first does anyone know what kind of object i would need to display that(i.e. textbox, etc)? And second, does anyone have suggestions on How to make this work? thanks
ParadigmShift
ParadigmShift
Don''t. Just don''t do it.

The only object I''ve found to do that is JEditorPane, which supports RTF and HTML formatting. I tried to use it in an AIM client, and it failed miserably. Font sizes were messed up, you couldn''t reliably insert tags, there were spaces where there shouldn''t be, and images were totally broken. I think it actually got worse going from version 1.3 to 1.4...

If you want to implement your own HTML parser to use with this component, that might work better. Otherwise just write your own.

Tom
"E-mail is for geeks and pedophiles." -Cruel Intentions
Lando
Lando
Thanks, that helps, because I didn''t know how feasible the idea was.. I may work on my own parser, because it''s not the fact the the tags are HTML that''s important, i just wanted a good way to add something extra to the text(images, etc).

Lando

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.