Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Colored Text for SQL Editor  RSS feed

 
Serghei Jelauc
Ranch Hand
Posts: 128
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all!
I want to create small SQL editor and I want all reserved words from SQL(insert, select, update and so on) had other color. I have idea how to check if this words is SQL operator, but I do not know how to change their color during input process.
May be somebody can suggest me how to do it, or give me a link on example.
Thanks in advance and sorry for my English.
 
Chantal Ackermann
Ranch Hand
Posts: 508
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you will have to use the JTextPane component. you can define different Styles and apply them to the different keywords.
I think I posted some sample code on this a while ago, you would have to search the archives to find it. Otherwise, start with the Swing Tutorial on JTextPane.
chantal
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!