java - Input from a multiline TextArea into an array with NetBeans? -


what need have happen: take list of names multiline textarea, put them array, modify them bit, , print them out in list.

what i'm having problems with: getting input textarea , sticking in array -- have rest down. read someone's similar question, solution question isn't working me; keep getting nullpointerexception when reference it, meaning there's nothing there, , input wasn't put array.

the coding: textarea called "taclient" , activated mouse click on 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 modifications , other code , printout.      } 

as far i'm aware, should work, don't have experience textareas or string.split() method, way off. (plus, said before, design based off of else's question on here, , said answer solved problem...but not mine.)

thanks in advance!

did try split string 1 backslash, likes this: .split("\n").


Comments

Popular posts from this blog

windows - Single EXE to Install Python Standalone Executable for Easy Distribution -

c# - Access objects in UserControl from MainWindow in WPF -

javascript - How to name a jQuery function to make a browser's back button work? -