Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

syntax highlighting in swing

  • 03-03-2004 3:40pm
    #1
    Closed Accounts Posts: 36


    Anyone have any ideas about how i could do syntax highlighting when a user is writing into a Swing JTextComponent?

    e.g. when a user presses space when editing code, there is a new word, read in that word, slap it in to a hashmap to see if it is a keyword, then change that words style.

    Thanks


Comments

  • Closed Accounts Posts: 1,525 ✭✭✭vorbis


    if you add a caret listener to the jtextcomponent you can listen for e3ach character pressed., If the character is a space, I guess you could do something with the word just typed.


Advertisement