• 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.
  • Popular Now

  • Posts

    • Download Natural Language Processing with Python (worth $39.99) for free by Steven Parker Claim your complimentary eBook worth $39.99 for free, before the offer ends on June 25. Begin with foundational concepts like text preprocessing, tokenization, and key Python libraries such as NLTK, spaCy, and TextBlob. Explore the challenges of text data and gain hands-on experience in cleaning, tokenizing, and building basic NLP pipelines. Early chapters provide practical exercises to solidify your understanding of essential techniques. Advance to sophisticated topics like feature engineering using Bag of Words, TF-IDF, and embeddings like Word2Vec and BERT. Delve into language modeling with RNNs, syntax parsing, and sentiment analysis, learning to apply these techniques in real-world scenarios. Chapters on topic modeling and text summarization equip you to extract insights from data, while transformer-based models like BERT take your skills to the next level. Each concept is paired with Python-based examples, ensuring practical mastery. The final chapters focus on real-world projects, such as developing chatbots, sentiment analysis dashboards, and news aggregators. These hands-on applications challenge you to design, train, and deploy robust NLP solutions. With its structured approach and practical focus, this book equips you to confidently tackle real-world NLP challenges and innovate in the field. This free to download offer expires June 25. How to get it Please ensure you read the terms and conditions to claim this offer. Complete and verifiable information is required in order to receive this free offer. If you have previously made use of these free offers, you will not need to re-register. While supplies last! Download Natural Language Processing with Python (worth $39.99) for free Offered by Packt, view other free resources The below offers are also available for free in exchange for your (work) email: AI and Innovation ($21 Value) FREE – Expires 6/11 Unruly: Fighting Back when Politics, AI, and Law Upend [...] ($18 Value) FREE - Expires 6/17 SQL Essentials For Dummies ($10 Value) FREE – Expires 6/17 Continuous Testing, Quality, Security, and Feedback ($27.99 Value) FREE – Expires 6/18 VideoProc Converter AI v7.5 for FREE (worth $78.90) – Expires 6/18 Macxvideo AI ($39.95 Value) Free for a Limited Time – Expires 6/22 Microsoft 365 Copilot At Work ($60 Value) FREE – Expires 6/25 Natural Language Processing with Python ($39.99 Value) FREE – Expires 6/25 Excel Quick and Easy ($12 Value) FREE – Expires 6/24 The Inclusion Equation: Leveraging Data & AI ($21 Value) FREE – Expires 6/24 The Ultimate Linux Newbie Guide – Featured Free content Python Notes for Professionals – Featured Free content Learn Linux in 5 Days – Featured Free content Quick Reference Guide for Cybersecurity – Featured Free content We post these because we earn commission on each lead so as not to rely solely on advertising, which many of our readers block. It all helps toward paying staff reporters, servers and hosting costs. Other ways to support Neowin The above deal not doing it for you, but still want to help? Check out the links below. Check out our partner software in the Neowin Store Buy a T-shirt at Neowin's Threadsquad Subscribe to Neowin - for $14 a year, or $28 a year for an ad-free experience Disclosure: An account at Neowin Deals is required to participate in any deals powered by our affiliate, StackCommerce. For a full description of StackCommerce's privacy guidelines, go here. Neowin benefits from shared revenue of each sale made through the branded deals site.
    • If your SMS service implements RCS E2E encryption, go for it, there's really no difference. But switching to Telegram, for example? Why? Telegram also shows you ads, if you didn't know, and they were doing it before WhatsApp. Also, Telegram isn't E2E encrypted by default, you have to manually enable it for every chat.
  • Recent Achievements

    • Week One Done
      patrickft456 earned a badge
      Week One Done
    • One Month Later
      patrickft456 earned a badge
      One Month Later
    • One Month Later
      Jdoe25 earned a badge
      One Month Later
    • Explorer
      Legend20 went up a rank
      Explorer
    • One Month Later
      jezzzy earned a badge
      One Month Later
  • Popular Contributors

    1. 1
      +primortal
      641
    2. 2
      ATLien_0
      278
    3. 3
      +FloatingFatMan
      171
    4. 4
      Michael Scrip
      156
    5. 5
      Steven P.
      128
  • Tell a friend

    Love Neowin? Tell a friend!