What I need have happen: Take a list of names from a multiline TextArea, put them into an array, modify them a bit, and then print them out in a list.
What I'm having problems with: Actually getting the input from the TextArea and sticking it in an array -- I have the rest down. I read someone's similar question, but the solution for that question isn't working for me; I keep getting a NullPointerException when I reference it, meaning that there's nothing there, and that the input wasn't put into the array.
The coding: The TextArea is called "taClient" and is all activated by a mouse click on a button called "btnProcess"
private void btnProcessMouseClicked(java.awt.event.MouseEvent evt)
{
String[] names = taClient.getText().split("\\n");
Account[] account = new Account[names.length];
for(int x = 0; x<names.length; x++)
{
account[x].Name = names[x];
}
//All the modifications and other code and printout.
}
As far as I'm aware, this should work, but I don't have much experience with textareas or the String.split() method, so I could just be way off. (Plus, as I said before, this design was based off of someone else's question on here, and they said this answer solved their problem...but not mine.)
Thanks in advance!