Results 1 to 11 of 11
  1. #1
    joypik is offline Member
    Join Date
    Jun 2010
    Posts
    17
    Rep Power
    0

    Question multi selection of text

    Can i get code to implement MULTIPLE SELECTION OF TEXT in a text editor.
    Can any one help..............plzzzzzzzzzz:(

  2. #2
    JvlShz is offline Member
    Join Date
    Jun 2010
    Posts
    26
    Rep Power
    0

    Default

    rephrase your question plzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz

  3. #3
    joypik is offline Member
    Join Date
    Jun 2010
    Posts
    17
    Rep Power
    0

    Default

    we can select multiple folders in windows.
    Likewise i want to select a text in a trext editor

  4. #4
    JvlShz is offline Member
    Join Date
    Jun 2010
    Posts
    26
    Rep Power
    0

    Default

    do you mean multiple lines or multiple selection instances?

  5. #5
    joypik is offline Member
    Join Date
    Jun 2010
    Posts
    17
    Rep Power
    0

    Default

    yes, u are right

  6. #6
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    Quote Originally Posted by joypik View Post
    yes, u are right
    I suggest that either you mark this question as solved or ask a more detailed question, because right now, you're still not asking an answerable question.

  7. #7
    joypik is offline Member
    Join Date
    Jun 2010
    Posts
    17
    Rep Power
    0

    Default

    i mean can we select multiple lines of text i.e can we select lines alternatively or randomly or many instances of lines in text.
    Is the question now understandable?

  8. #8
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,537
    Blog Entries
    7
    Rep Power
    20

    Default

    Quote Originally Posted by joypik View Post
    i mean can we select multiple lines of text i.e can we select lines alternatively or randomly or many instances of lines in text.
    Is the question now understandable?
    You can't do that; the text models support one contiguous area of text to be marked; you can't have several of then. Read the API documentation for the Caret interface (you can only have one Caret per text model).

    kind regards,

    Jos

  9. #9
    camickr is offline Senior Member
    Join Date
    Jul 2009
    Posts
    1,236
    Rep Power
    7

    Default

    You can't "select" multiple lines or blocks of text.

    You can "highlight" multiple blocks of text. You can use a Highlighter for this. Read the API, I think you use getHighlighter() to add highlights.

    Or, if you really do need the ability to select multiple lines then use a JList where each item in the list is a line of text.

  10. #10
    joypik is offline Member
    Join Date
    Jun 2010
    Posts
    17
    Rep Power
    0

    Default

    can u get me some code that implements selection of multiple blocks and also another alternative you said about

  11. #11
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,537
    Blog Entries
    7
    Rep Power
    20

    Default

    Quote Originally Posted by joypik View Post
    can u get me some code that implements selection of multiple blocks and also another alternative you said about
    Camickr publishes an excellent website: link, with a lot of examples, ready to run code and great explanations; when it comes to Swing his website is bookmarked next to Sun's Swing Tutorials.

    kind regards,

    Jos

    ps. you should search for 'highlighter' on his site.

Similar Threads

  1. discontinuous text selection
    By joypik in forum New To Java
    Replies: 4
    Last Post: 06-16-2010, 07:48 AM
  2. Replies: 1
    Last Post: 04-26-2010, 01:02 PM
  3. Single and Multi Selection Lists
    By Java Tip in forum SWT Tips
    Replies: 0
    Last Post: 07-02-2008, 08:03 PM
  4. How to highlight text by drag and selection
    By Java Tip in forum java.awt
    Replies: 0
    Last Post: 06-25-2008, 10:35 AM

Posting Permissions

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