Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Thread: Get a certain line in a JTextField

  1. #1
    Junior Member
    Join Date
    May 2010
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Get a certain line in a JTextField

    Hi!

    I got a problem when trying to get my pice of code working.
    I need a JTextField or JTextArea (or any type which is good in this case), where I have an unknown amount of rows (supposed to able to add and remove rows). You're supposed to be able to click a line and the text in the line should be returned, only that line.


  2. #2
    mmm.. coffee JavaPF's Avatar
    Join Date
    May 2008
    Location
    United Kingdom
    Posts
    3,336
    My Mood
    Mellow
    Thanks
    258
    Thanked 294 Times in 227 Posts
    Blog Entries
    4

    Default Re: Get a certain line in a JTextField

    I am slightly confused. Have you started to write any code yet?

    You could do something like text.getText(); displayed in a JOptionPane

    Swing Tutorial: Alert Dialogs (JOptionPane)
    Please use [highlight=Java] code [/highlight] tags when posting your code.
    Forum Tip: Add to peoples reputation by clicking the button on their useful posts.

  3. #3
    Junior Member
    Join Date
    May 2010
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Get a certain line in a JTextField

    I solved it in a completely different way tho.
    But I ment having like a list of persons (for instance) where each line had information about the person (name, adress etc.) on the same row, and if u click the row u returned the text in that row.

Similar Threads

  1. Passing JTextField as String parameter
    By Christophe in forum Java Theory & Questions
    Replies: 3
    Last Post: April 11th, 2010, 05:32 AM
  2. Issue with JTextField Locking
    By PekinSOFT.Systems in forum AWT / Java Swing
    Replies: 0
    Last Post: October 1st, 2009, 11:12 AM
  3. [SOLVED] JTextField not visible in swing
    By Sterzerkmode in forum AWT / Java Swing
    Replies: 4
    Last Post: May 21st, 2009, 07:37 AM
  4. Reading a file line by line using the Scanner class
    By JavaPF in forum File Input/Output Tutorials
    Replies: 0
    Last Post: April 17th, 2009, 07:34 AM
  5. How to Read a file line by line using BufferedReader?
    By JavaPF in forum File Input/Output Tutorials
    Replies: 0
    Last Post: May 19th, 2008, 06:32 AM