Right sorry, doesn't work means doesn't compile. I am using JBuilder and
the compiler just refuses to run this, claims its missing a parenthesis.
My java knowledge is a little sketchy as I keep forgetting things that I
knew a few years ago especially when I stop doing java for a few years.
Data is an object that contains string data for a table and I am trying to
retrieve some table data. I thought that valueOf was a sort of universal
function that could accomplish this.
I am pretty sure that this syntax is OK data[1,1] for retrieving the item
in the 1,1 position.
The table elements are defined as follows:
String[] columnNames = {"Dia. (in)",
"Instal. cost"};
Object[][] data = {
{"3", "$25"},
{"4", "$30"},
{"5", "$35"},
{"6", "$45"},
{"8", "$55"}
};
Jacques
Monique Y. Mudama said:
hi, I am trying to retrieve data from a jTable with this
instruction:
jLabelPipec1.setText(""+ valueOf(data[1,1]));
the data array is an objet as required for a table.
and of course it doesn't work. Any suggestions appreciated.
Um.
Okay, I'll start with the first question: in what class does the above
line live? Is there any reason I should know what valueOf does
without knowing which class it belongs to?
I don't recognize the syntax data[1,1] as anything you can do in Java,
although it's late and my brain is fried, so I may be wrong.
Oh! One more! Please define "doesn't work." Doesn't compile? If so,
what does the compiler say?
--
monique
Ask smart questions, get good answers:
http://www.catb.org/~esr/faqs/smart-questions.html