Results 1 to 3 of 3
Thread: Syntax Colouring
- 02-16-2009, 11:37 AM #1
Member
- Join Date
- Oct 2008
- Posts
- 63
- Rep Power
- 0
- 02-16-2009, 02:55 PM #2
First of all why would you want to code in a JTextArea? But anyway, to answer your question, you could, but you would need a JStyledPane or JTextPane to have multiple colours in one text box. I'm not sure how it would work, whether you would constantly be checking the entire string to find regular expressions which are java keywords, and then changing their colour when found, or maybe only do it when you click a button, or lose focus, or the typing pauses, etc.
Hope this helps.
-MK12Tell me if you want a cool Java logo avatar like mine and I'll make you one.
- 02-16-2009, 04:46 PM #3
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
I think you can use formatted fonts over the controls. Read about Font class.
Similar Threads
-
simple loop syntax( ; ;), ( something : somthing)
By xcallmejudasx in forum New To JavaReplies: 4Last Post: 12-13-2008, 12:19 PM -
[SOLVED] Looking for web.xml syntax doc
By Norm in forum Java ServletReplies: 2Last Post: 08-21-2008, 07:59 PM -
Syntax for choice box(combo box)
By NickkicN in forum New To JavaReplies: 2Last Post: 08-14-2008, 10:26 PM -
Cannot get passed these syntax errors
By MrKP in forum New To JavaReplies: 1Last Post: 05-12-2008, 07:05 AM -
syntax error
By gabriel in forum New To JavaReplies: 3Last Post: 08-03-2007, 03:26 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks