Results 1 to 2 of 2
  1. #1
    simmi is offline Member
    Join Date
    Apr 2009
    Rep Power

    Thumbs up Highlighting and retrieving current row text of jtextarea

    Hi All,

    I am new to java swings.I need to build up a Java Swings GUI.If i click on a menu item "select name" from the main menu "new",a dialog box should open up.In that dialog box there should be a jtextarea and a jtextfield.In textarea i want to add few names,each name on different line and when i select a name from jtextarea that name should get highlighted and get filled up in jtextfield.Jtextfield can only have the value selected in jtextarea.

    It would be great if somebody can help me on this ASAP.
    Thanks in advance:)


  2. #2
    markw8500's Avatar
    markw8500 is offline Senior Member
    Join Date
    Jul 2008
    Pennsylvania, USA
    Rep Power


    You can probably manage this with a mouselistener... Whenever the mouse is released, if there is selected text in the textarea, it will set the text of the textfield...
    Who Cares... As Long As It Works...

Similar Threads

  1. Replies: 4
    Last Post: 02-06-2009, 11:32 AM
  2. Need Help showing text in JTextArea
    By GuyFawkes in forum AWT / Swing
    Replies: 3
    Last Post: 05-05-2008, 10:19 AM
  3. JTextArea - text align
    By bradder in forum AWT / Swing
    Replies: 1
    Last Post: 11-29-2007, 08:08 PM
  4. viewing the contents of a text file in JTextArea
    By warship in forum New To Java
    Replies: 0
    Last Post: 07-17-2007, 03:29 PM

Posting Permissions

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