Обсуждение: select w/Swing's JTable widget
Hi, I would first like to thank all developpers that are working on PostgreSQL. It's an awesome piece of software. Secondly, I've a simple question. I'm developping a small application in Java and I use the Swing (JFC) widgets set. I have to do a select on a table and put the result in a JTable object. My question is, how (in an efficient manner) should I construct my JTable object since I do not know in advance how many rows I'll have (available through my resultset). Playing with Vector objects is annoying and with Object[]{[]} .. it's pretty static :) Thanks a lot, Ludovic
Ludovic Marcotte once wrote: > > Hi, > I would first like to thank all developpers that are working on > PostgreSQL. It's an awesome piece of software. > I second that. > Secondly, I've a simple question. I'm developping a small application in > Java and I use the Swing (JFC) widgets set. I have to do a select on a > table and put the result in a JTable object. My question is, how (in an > efficient manner) should I construct my JTable object since I do not know > in advance how many rows I'll have (available through my resultset). The model side of it ? - then think again. The component side of it ? - then the swing list is THE place to look for. > Playing with Vector objects is annoying and with Object[]{[]} .. it's > pretty static :) > What's wrong with Vectors (or Collections) ? > Thanks a lot, > Ludovic
On Sat, 4 Jul 1998, Ludovic Marcotte wrote: > Hi, > I would first like to thank all developpers that are working on > PostgreSQL. It's an awesome piece of software. > > Secondly, I've a simple question. I'm developping a small application in > Java and I use the Swing (JFC) widgets set. I have to do a select on a > table and put the result in a JTable object. My question is, how (in an > efficient manner) should I construct my JTable object since I do not know > in advance how many rows I'll have (available through my resultset). > Playing with Vector objects is annoying and with Object[]{[]} .. it's > pretty static :) I once played with Swing some time ago, with little success (it brought the machine down). That was some time ago, so I'll be looking at swing again fairly soon. There is no way of knowing how many rows are in a ResultSet, without reading in the entire set. Also, I thought JTable could handle ResultSet's? -- Peter T Mount peter@retep.org.uk or petermount@earthling.net Main Homepage: http://www.retep.org.uk ************ Someday I may rebuild this signature completely ;-) ************ Work Homepage: http://www.maidstone.gov.uk Work EMail: peter@maidstone.gov.uk