Meaningless Drivel is fun!*
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


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JTextPane and creating reserved words" Watch "JTextPane and creating reserved words" New topic
Author

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
Sheriff

Joined: Oct 27, 2005
Posts: 19649
    
  18

Syntax Highlighting by Ostermiller.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
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.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: JTextPane and creating reserved words
 
Similar Threads
about keywords
Basic question on foundational Java
Any Idea? Valid Class Identifiers
Usage of Reserved words for Database Table fields
Reserved words