My task is to create a Java char client/server application. I always have huge problems with GUI in java.
I'm currently struggling to create a simple chat log that will be able to display both colored text (specifically administrator users should appear red) and GUI elements (button to download a file that has been sent).
I have tried lots of things including HTML, but everything has a flaw.
For the messages, my latest solution are jpanels filled with jlabels of different color and it's all contained in jscrollpane. It's the best solution so far, but it's still really bad.
- JPanels are trying to fit in centre both vertically and horizontally. If there's only one message, it's in the middle of the log.
- Text in JPanels cannot be highlighted - so it cannot be copied out.
Is there any XXXPanel that has been designed for purpose of displaying formated text? The panel with HTML did not accept either CSS or <font>
tag attributes - so I doubt it had the capability of being colored.