aspose file tools*
The moose likes Beginning Java and the fly likes JAVA source editor Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "JAVA source editor" Watch "JAVA source editor" New topic
Author

JAVA source editor

Peter Tran
Bartender

Joined: Jan 02, 2001
Posts: 783
I would like to display some Java source code using a JTextPane. Furthermore, I would like to color-code the JAVA keywords to make it easier to view the source file. My questions are:
1. What's the easiest and most efficient way to parse an entire JAVA source file to find the JAVA keywords (e.g. if, else, while, class, etc.)?
2. Would a JTextPane be the best GUI component to use?
Thanks,
-Peter
greg philpott
Ranch Hand

Joined: Nov 10, 2000
Posts: 73
check out www.jedit.org
Its open source and might save you a lot of work ,and be interesting for you to look at and see how they did it.
Peter Tran
Bartender

Joined: Jan 02, 2001
Posts: 783
Greg,
Thanks. I'll take a look. Amen to Open Source projects.
-Peter
Johannes de Jong
tumbleweed
Bartender

Joined: Jan 27, 2001
Posts: 5089
Peter you might want to look at this as well Modern Compiler Implementation in Java
(edited to fix URL)
[This message has been edited by Cindy Glass (edited September 28, 2001).]
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: JAVA source editor