File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Swing / AWT / SWT and the fly likes can't get to distribute my individual datas into row in JTable Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "can Watch "can New topic
Author

can't get to distribute my individual datas into row in JTable

joseph okon
Ranch Hand

Joined: Dec 07, 2004
Posts: 63
hi everybody in the house
i am try to insert datas from database into Jtable rows, that is i want to add another row to the bottom of my table
the issue is these
i use vector utility to collate my datas from the database then add it to the table, ok fine!! i got the datas into my vector and add, but instead of it distributing it to different cells, it only add to a particular cell which is not what i want.
take a look into my code.
this is working mechine to get the datas from the batabase into the vector.

And this is the table adding part

please i need to know what i did wrong cause it is getting me off the edge
thanks
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19541
    
  16

You are treating your Vector of Vectors, which should be your model's entire data set, as a simple row Vector. You should iterate over this Vector, adding each Vector separately.

And instead of using insertRow you can use addRow to add a row to the end.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
joseph okon
Ranch Hand

Joined: Dec 07, 2004
Posts: 63
please can you write an example short code to show this
thanks
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19541
    
  16

I'm sure you can write a simple loop and the casting of each element to Vector yourself, can't you?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: can't get to distribute my individual datas into row in JTable
 
Similar Threads
Jtable showing last record only
Columns on JTable
iscelleditable is not working in jtable
add an empty row to the Jtable
Getting Last Record in Jtable