File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Swing / AWT / SWT and the fly likes JTextPane and creating reserved words Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JTextPane and creating reserved words" Watch "JTextPane and creating reserved words" New topic

JTextPane and creating reserved words

Jhedzkie Skies
Ranch Hand

Joined: Oct 28, 2009
Posts: 118
hi there. i would like to get some idea on this

i want to use a textpane and make it act like a compiler
will detect reserved words and change its color different from normal texts

my idea is a separate class of enum containing the reserved words and the text pane should have a document listener or such...

somebody help me started please. correct my concept if im wrong
Rob Spoor

Joined: Oct 27, 2005
Posts: 19544

Syntax Highlighting by Ostermiller.

How To Ask Questions How To Answer Questions
Jhedzkie Skies
Ranch Hand

Joined: Oct 28, 2009
Posts: 118
Rob Prime wrote:Syntax Highlighting by Ostermiller.

that should wrap it up. thanks.

package com.Ostermiller does not exist. while gnu.getopt within the same jar is being recognized.

thanks. i managed to make it work.
I agree. Here's the link:
subject: JTextPane and creating reserved words
Similar Threads
Any Idea? Valid Class Identifiers
Reserved words
about keywords
Usage of Reserved words for Database Table fields
Basic question on foundational Java