JTable with vector

hi guys,i am looking for some code that can be used to populate a JTable with a Vector.chaminda
[116 byte] By [chamindara] at [2007-11-26 14:43:09]
# 1
You mean like this constructor:JTable(Vector rowData, Vector columnNames)
DrLaszloJamfa at 2007-7-8 8:30:47 > top of Java-index,Java Essentials,New To Java...
# 2
insatantiate Jtable with ur own defined TableModel.That table model should have, Data vector(Which is aVector of Vector )and header String array. Then to add row to a table just add a vector having information with the data Vector. Thats it.
Er.Vela at 2007-7-8 8:30:47 > top of Java-index,Java Essentials,New To Java...
# 3
What's wrong with just using the constructor I mentioned, if it works?
DrLaszloJamfa at 2007-7-8 8:30:47 > top of Java-index,Java Essentials,New To Java...
# 4
No, DrLaszloJamf , I did'nt say thats urs is wrong Just i posted my Idea.
Er.Vela at 2007-7-8 8:30:47 > top of Java-index,Java Essentials,New To Java...
# 5
hithanx for your advice. could u pls give me a url for an example to my query if you can?thanxchaminda
chamindara at 2007-7-8 8:30:47 > top of Java-index,Java Essentials,New To Java...
# 6

You'll find the java source code example that you're looking for here:

http://www.exampledepot.com/egs/javax.swing.table/Table.html

It will show you how to populate a JTable component with a Vector. Also check out http://www.exampledepot.com/egs/javax.swing.table/pkg.html for lots of java source code examples that will help you learn to use the JTable component. Finally you should look at Sun's swing tutorials. They contain lots of good examples.

kevinotta at 2007-7-8 8:30:47 > top of Java-index,Java Essentials,New To Java...
# 7
hey thanks a lot buddy for the url. it did the job
chamindara at 2007-7-8 8:30:47 > top of Java-index,Java Essentials,New To Java...