Ok basically what I am doing is i have a jtable in which users can enter their information into the table, I then want to be able to save it into a text file. The problem I am running into however is along the lines of this.
private static String dataValues[][];
I want to be able to declare dataValues like this so I can accesses it in every method so I can add rows to my jtable like this:
dataValues = {{number, owner, txtDate"}};
tableModel.addRow(dataValues);
however I get an error on the dataValues saying that "Array constants can only be used in initializers." And i dont really understand what that means.
if I declare the variable like this in the actual method it works.
String[][] dataValues = {{number, owner, txtDate}};
But I need to be able to access it anywhere in the program so declaring it like that will not help me.
Thanks for the help in advance.