views:

80

answers:

4

Hello, I am looking for some Java Swing component (textarea like) which is aware of SQL syntax - meaning it recognizes and highlights it.

If there isn't I will need to do it myself, any useful advices there how not waste too much of time (eg. which component to use) ?

+1  A: 

You could have a look at SQuirreL SQL. After a quick look at the source code I think it uses Swing and it has an SQL editor with syntax highlight and even content assist.

musiKk
+3  A: 

JSyntaxPane appears to support SQL highlighting (I have not tried it myself).

Mark
Looks good, I will test it out in following days and will report here. Thank you so far.
Xorty
Ok I am satisfied :D Works really nice.
Xorty
+2  A: 

I have used Ostermiller's Syntax Highlighter before. It is as simple as:

HighlightedDocument document = new HighlightedDocument();
JTextPane textPane = new JTextPane(document);
dogbane
+1  A: 

The MIT-licensed jEdit syntax package supports SQL and many other languages.

I've use the commercial JIDE Code Editor, which uses jEdit and works very well.

Geoffrey Zheng
If only JIDE Code Editor would some day come out of the beta stage... I think it has been beta maybe for two years now.
Carlos
@Carlos: did you find any major problems? I just started to use it and find it ok so far. When did gmail come out of beta?
Geoffrey Zheng
No. I'm sure it works and most certainly better than jEdit syntax package. But obviously there is still something missing, otherwise they wouldn't keep it in beta. I was just wondering if they are actively developing it. I didn't mean to criticize the component itself.
Carlos
@Carlos: hey now I remember you from the [JIDE answer](http://stackoverflow.com/questions/2055647/looking-for-a-feedback-on-jide/2058811#2058811 "JIDE Fan Club")! No wonder... Why don't you just ask them on the forum, then. You know David will get back to you in no time.
Geoffrey Zheng
It's not an issue for me at the moment, that's just something I've been wondering. At some point I need to replace the syntax package, but that's not the most urgent problem. I want to clarify, that my original comment was not meant as criticism or to discourage from using it, just an observation.
Carlos