Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JTextArea

 
Craig Parsons
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a JTextArea where the user enters data separated by semi-colons ( . When the users finishes they click the edit button.
I need to copy the each piece of data separated by the semicolon into an array of strings.
Any suggestions?
Thanks,
Craig
 
Don Kiddick
Ranch Hand
Posts: 580
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What part of the problem are you having difficulty with ?
I'm not going to do your homework for you....
D.
 
Craig Parsons
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am able to copy everything from the JTextArea into a string but I need to get that string broken down into array of strings based on the ( delimiters located in the string.
Everything else is OK.
 
ben riches
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Craig Parsons:
I am able to copy everything from the JTextArea into a string but I need to get that string broken down into array of strings based on the ( delimiters located in the string.
Everything else is OK.

Take a look at StringTokenizer.
 
Jose Botella
Ranch Hand
Posts: 2120
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
String.split(String) is easier to use.
 
Craig Parsons
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have implemented StringTokenizer and like how it works.
Thanks for your help.

Don - Not everybody is asking for other people to do their homework. Sometimes the easiest part about being a new programmer is visualizing what needs to be done. With all the different methods, classes, and options out there the hard part is finding the correct one that fits into your visual picture.
 
Don Kiddick
Ranch Hand
Posts: 580
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'll help someone with any problem whether homework or not. I wont just write someone's code for them, I require that they show some evidence that they've given it a go. In your first post you did not show any evidence, so I didn't help you !
I would have helped after you replied but Ben got there before me (4 minutes, impressive ! ).
D.
 
Craig Parsons
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Understood. I'll try to be more descriptive next time.
Have a good one.
 
I can't take it! You are too smart for me! Here is the tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!