What problem are you trying to solve?
There are two different solutions posted earlier in the thread.
Type: Posts; User: Norm
What problem are you trying to solve?
There are two different solutions posted earlier in the thread.
I think for a student I'd leave the regex for version 2. Keep it simpler for version 1.
For example after indexOf() finds the word, verify that the char before and the char after is a terminating...
Nice job dlorde!
Using JTextPane moves the difficulties further on to the output step.
The JTP handles word wrap and can be in a JScrollPane to allow for longer text. Setting the color for a...
Sorry, I don't understand your question. What is a "reterns"?
To find where the words that are colored are located, you'd need to save their location as you colored them
Yes, I think that could be done. I'm experimenting with the JTextPane (JTP) class as a possibility for your project.
The way it works is:
You add text to the JTP
When you want to color a word,...
That what HTML is made up of: Strings of text.
Sounds like HTML
The coloring controls for the text being displayed would be around somewhere that you could read and use when you create the HTML.
I've never done this, so I'm not sure where they would be.
I understand the first part, but not this part.
What is the output to look like? How are the colored words to be represented?
If you output the text with markup like HTML then the coloring could...
There are different ways to scan a String. One is to use delimiters and you seem to be thinking to use a comma.
here you are running ahead and thinking of how you are going to implement some of...
Start with small bits and add to it as you go.
Do what?
Please explain what adding commas will do for your problem.
What have you coded so far?
Look at the JEditorPane class as a way to have different lines in different colors.