Results 1 to 2 of 2
Like Tree1Likes
  • 1 Post By SurfMan

Thread: Read chars in Text area and produce desired output, for Text Editor project

  1. #1
    Join Date
    Dec 2013
    Location
    Dublin
    Posts
    33
    Rep Power
    0

    Default Read chars in Text area and produce desired output, for Text Editor project

    Hi
    I am working on a personal project and want to create a text editor to write my code. I am wondering how could I read the last input from the user and if say it was an open curly brace {, then like netbean's my editor will supply the closing curly brace. My java experience is limited but I have tried to read key board input and a few other options that did not work. I would really appreciate some help and guidance on the subject please?

  2. #2
    SurfMan's Avatar
    SurfMan is offline Godlike
    Join Date
    Nov 2012
    Location
    The Netherlands
    Posts
    1,991
    Rep Power
    8

    Default Re: Read chars in Text area and produce desired output, for Text Editor project

    You could look into the DocumentListener you can add to the JTextAreas document. It will give you methods to hook into insert and delete moments.

    Just so you know, re-creating an IDE's autocomplete feature and all the other gizmos you get from an IDE is very complex. Be prepared to encounter lots of quirky Java Swing code.
    Castro__711 likes this.
    "It's not fixed until you stop calling the problem weird and you understand what was wrong." - gimbal2 2013

Similar Threads

  1. adding text to a text area dynamically
    By tom2zip in forum AWT / Swing
    Replies: 3
    Last Post: 01-17-2012, 05:58 AM
  2. Replies: 8
    Last Post: 07-17-2011, 02:38 PM
  3. Replies: 2
    Last Post: 04-27-2011, 04:09 PM
  4. Replies: 0
    Last Post: 12-09-2010, 05:56 PM
  5. Replies: 0
    Last Post: 09-28-2010, 09:52 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •