Results 1 to 5 of 5
- 01-15-2011, 02:31 PM #1
Senior Member
- Join Date
- Feb 2009
- Posts
- 117
- Rep Power
- 0
adding more entries at a multidimensional array using a loop
how do you add items at multidimensional array? the manual type is very simple. I used this
but my problem is that the entries are not static, they are coming from a jdbc result set.Java Code:private Object[][] data = { {"Kathy", "Smith", "Snowboarding", new Integer(5), new Boolean(false)}, {"John", "Doe", "Rowing", new Integer(3), new Boolean(true)}, {"Sue", "Black", "Knitting", new Integer(2), new Boolean(false)}, {"Jane", "White", "Speed reading", new Integer(20), new Boolean(true)}, {"Joe", "Brown", "Pool", new Integer(10), new Boolean(false)} };
I am trying to see if it is possible for me to loop those things on my result set so I can place them on a multidimenstional array.
-
It looks as if you're trying to create data to be displayed in a Swing JTable. If so, then don't use arrays, but use Vector of Vectors instead and a DefaultTableModel object. Or any other collection such as ArrayList, but then you'll need to use an AbstractTableModel, not the DefaultTableModel.
- 01-15-2011, 10:07 PM #3
Senior Member
- Join Date
- Feb 2009
- Posts
- 117
- Rep Power
- 0
ok then, i think that is all that I need to know. thank you very much :D
-
- 01-15-2011, 11:44 PM #5
Senior Member
- Join Date
- Feb 2009
- Posts
- 117
- Rep Power
- 0
Similar Threads
-
initialize multidimensional array
By Aidoru in forum New To JavaReplies: 2Last Post: 12-04-2010, 01:00 PM -
Adding up all values generated from a for-loop
By BariMutation in forum New To JavaReplies: 4Last Post: 10-10-2010, 05:31 PM -
Retrieve Multidimensional Array ??
By oneofthelions in forum New To JavaReplies: 3Last Post: 12-12-2009, 07:24 AM -
Navigate through a multidimensional array
By VinTiger in forum New To JavaReplies: 4Last Post: 05-05-2009, 07:16 PM -
[SOLVED] Multidimensional array
By Torgero in forum New To JavaReplies: 20Last Post: 03-22-2009, 11:36 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks