0
Hello, I have a question regarding storing the value I get from a table in an arraylist of arraylist. As I should do to be able to store?
For example:
Private ArrayList<ArrayList<String>> valorMatriz = new ArrayList<ArrayList<String>>();
String v;
int linha = jTable2.getRowCount();
int coluna = jTable2.getColumnCount();
for(int i = 0; i < linha; i++){
for(int j = 0; j< coluna; j++){
valor = jTable2.getValueAt(i,j).toString();
//código que armazena a variável valor em valorMatriz
print(valor + " ");
}
}
Question: what is the syntax for storing the v variable in Triz value?
Are you having any problems? Everything seems okay, but I don’t know, it lacks better context.
– Maniero
It’s kind of weird, the
private
should havep
tiny, and should have a()
at the end of the first line, but if your code is like this it is not even to compile. Specify exactly what problem you are having.– Math
The problem is the syntax itself, I’m not getting, although I’m looking for, a way (command) to store the value v inside of valueMatriz
– Renan Alboy
The lack of () was only here on hr to write, but the private with p minuscule error not.
– Renan Alboy
With the code informed you just can’t detect the problem. Add more of the implementation.
– user28595
To
string
is also with wrong capitalization, should beString
. It would be good for you to create a [mcve] so that it is possible to help you better.– Math
I haven’t seen any problems with the code yet. You need to be more specific. How much better or worse, makes the response opinionated, the kind the site does not encourage.
– user28595