Forums Register Login

JTextPane "lag" (not time issue, color issue)

+Pie Number of slices to send: Send


The code under "//later" is called every time you push enter. It takes text posted in a JTextArea and spits it out. The only problem I am having with it is that the color only shows up AFTER you push the next line... Why is it doing this and how do you fix it?
Thanks,
John Price aka cc11rocks
+Pie Number of slices to send: Send
 

It takes text posted in a JTextArea and spits it out.



A JTextArea doesn't support attributes.

Post your SSCCE that demonstrates the problem.
+Pie Number of slices to send: Send
The code shows a JTextPane is used so that would make more sense.

To add colours while you're typing you should use a DocumentListener. That will listen to events for new text, removed text and replaced text.
What's that smell? Hey, sniff this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 1041 times.
Similar Threads
Can you help me to remove this border?
JDK - Tomcat version compatibility
setting focus on the appended text in JTextArea
Why ModelDriven not working?
font color in JTextArea
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 16:36:45.