Question:
Java Color Coded Syntax?
rocketj3
2007-03-06 17:36:11 UTC
I'm unsure how to create a class that color codes words entered by syntax. I already have an application similar to Textpad, I just need to add this feature. please help!
Three answers:
JackBauer
2007-03-06 20:36:07 UTC
What I would do is to create a class A, to store all keywords in a data structure (i.e. hash table), and some kind of lookup routine that returns what type of matched text is (i.e. constants, literals, variables). Then in your display class, depending on what the type is, you can just change the color of the drawText() to the color from your class A.
petre
2016-11-28 08:04:58 UTC
NetBeans, it particularly is from sunlight. it is likewise the main suitable documented. NetBeans facilitates textbook code. Many different IDEs use proprietary code which you won't be able to tweak, and muddies up the photograph. Eclipse may be the main suitable element on account that sliced bread for all i be attentive to, yet no person ever took the time to record it. Futhermore, Eclipse is a memory hog and a a million/2. i replaced into astonished how quite some the pc's materials are devoured up whilst Eclipse is working. BlueJ is a lecture room gadget. Get NetBeans, in case you could have BlueJ, get the plug-in in NetBeans for BlueJ.
vincentgl
2007-03-09 07:56:38 UTC
Take a look at JEdit. It's open source, so download the source code and look at how the editor(s) do it.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...