Can I have different foreground colors in one text area? Different fonts?
I want to add something like “hh:mm:ss Nickname: message”, with time being gray, name – blue, message – black.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I made a mistake in my comment: it is JTextPane what you want, not JTextArea.
It turns out that seesaw supports JTextPane. See
(seesaw.core/styled-text), which createsJTextPanes, and(seesaw.core/style-text!)which applies different styles to the text inside the pane.Their usage seems to be pretty straightforward: first you define mapping
id -> styleduring pane construction, and then you use thisidwhen you assign styles to parts of the text.