I have a Processing code which displays words from a text file. I have created a right click function which erases words from the screen if they are not wanted, so that next time the code is run, those words should not be seen. I created another file containing all the delimiters/words that are not required. How do I add the unwanted words to this file, on the right click? I hope my question is clear. Thanks a lot for all help!
Share
When you start the application, I imagine you also load the delimiters/unwanted words text file and add those to a String[]. When there’s another right click, you append that right clicked word to the loaded String[] of unwanted words and then decide when you want to save the file(overwrite the previous definitions) – with a save button, using a timer, etc.
Here’s a quick snippet to illustrate the idea:
Note that normally and Array has a fixed size, but Processing’s append() function allows you to add new values to an existing array. Once you’re array is updated, all you need to do is save it back to the text file, so the new definitions will be there when you restart the application