• 0

[Java] Parsing and rendering control codes


Question

Summer's here and I want to start on a small project to not lose coding skills :ninja: (and have something to do while not at the beach/gaming), an IRC client for myself. I want to code it in Java as it's the language other than PHP I'm most comfortable with, but here's the thing.

I have experience parsing incoming server data, so that's not a problem. However, I have no clue as to how I can output formatted text using the IRC burk (bold, underline, reverse and color) codes. I have tried a couple of objects but failed. Does anybody here know how text can be output with the proper format? I suppose I could use something that emulates RichText, but is it possible to append text to such an object?

Thanks in advance. :)

6 answers to this question

Recommended Posts

  • 0

I remember you talking about this with babyorphan (I think) over at scriptaz ages ago. I thought about your comments last night (something about DrawTextEx() etc), hoping there'd be an easier way :p Oh well, I guess not.

I guess I'll start working on that. Thanks.

  • 0
  munashii said:
I remember you talking about this with babyorphan (I think) over at scriptaz ages ago. I thought about your comments last night (something about DrawTextEx() etc), hoping there'd be an easier way :p Oh well, I guess not.

I guess I'll start working on that. Thanks.

585071914[/snapback]

Oh man, that was so long ago. DrawText will handle multi-line wrapping, but not the control codes. That's why you have to manual do it. On top of that, there is scrolling. My control [zview] to do all this is over 2k lines of code.

  • 0
  munashii said:
Is it possible to append text to that without having to re-create the whole JEditorPane?

585071831[/snapback]

yes. the is most likely an append method too which will append text to the pane

Look up the Java API on these sorts of questions

- I think HTML is your best bet, it is easy to understand, you can easily show

color, different fonts, styles etc.

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.