Hello,
First of all I would like to say that Lanterna is a magic library. Exactly what I was looking for. Implement all these features in pure java, well done Martin !
But as you know, we always want more ...
I would need a custom component, something that looks like RichTextBox in C# (i.e. a list box of strings with colors)
Unfortunately the only component that supports the color I found is the Label.
So here is what I tried until now :
- Using ActionListBox and adding some Labels into it.
- It calls the toString() method of the Label but doesn't rendering it with its color (displays com.googlecode.lanterna.gui2.Label@xxxxxxxx)
- Using 2 Panels and a ScrollBar like the ScrollBarTest.
- I don't know if I can handle keystrokes to set the scrollbar position and scroll labels into the panel.
- I think that I will have an issue because I suspect that the label is not focusable so maybe no possibility for me to handle keystrokes.
Maybe that I could extend from the AbstractListBox class to make my own component. I guess that I will have to override the drawItem() method.
I know someone has managed to do it with a previous version of Lanterna and then Martin implemented that functionality (Topic link - Achievement)
Am I on the right track? If this is not the case thank you for pointing me out or giving me the list of things to do in order to reach my goal.