|
Thanks. If I use JList, what method I could use to add the resultSet array to the JList as the following example did? psAllRecord is a PreparedStatement object which select all records from a table (Using JDBC). The following code segment is to assign the values of resultSet to an array, then add the string array into the list box. public void populateListBox(){ java.sql.ResultSet rs = null; try{ rs = psAllRecord.executeQuery(); while (rs.next()){ String[] array = new String[5]; array[0] = rs.getString("PARTNO"); array[1] = rs.getString("PARTDS"); array[2] = insertSpaces(Integer.toString(rs.getInt("PARTQY")), 5); array[3] = insertSpaces(rs.getBigDecimal("PARTPR", 2).toString(), 8); array[4] = rs.getDate("PARTDT").toString(); ivjIMulticolumnListbox1.addRow(array, array[0]); } } catch (Exception e){ showException(e); } } Basically I have a set of results from AS400 DB table, and I want added them into a JList or JTable. -----Original Message----- From: Clapham, Paul [mailto:pclapham@core-mark.com] Sent: Wednesday, May 30, 2001 5:02 PM To: JAVA400-L@midrange.com Subject: RE: IMulticolumnListbox class The "ivj" part led me to believe that it is in VisualAge for Java, so I looked there (I have the Enterprise version running). It has a lot of packages named com.ibm.ivj.eab.something, in projects described as "IBM Enterprise Access Builder (something)". I couldn't find the specific class you mention, but perhaps it is in some optional function I didn't install. But if you are going to do an ordinary list box, JList would work well enough. PC2 -----Original Message----- From: Xu, Weining [mailto:Weining.Xu@AIG.com] Sent: May 30, 2001 13:15 To: 'JAVA400-L@midrange.com' Subject: IMulticolumnListbox class Does anyone know what class is this? The class has a method addRow(String[] array, String array[0]). The class and the method were mentioned in IBM redbook "Building AS/400 Client/Server Applications with Java (SG24-2152-02)", Chapter 3. AS/400 Toolbox for Java, as an example of populate data into a list box. In the examples, it says that the class is in the package com.ibm.ivj.eab.dad.* package. Where is this package? Does JList can do the same thing? (JList does not have addRow() method) Thanks for your help. +--- | This is the JAVA/400 Mailing List! | To submit a new message, send your mail to JAVA400-L@midrange.com. | To subscribe to this list send email to JAVA400-L-SUB@midrange.com. | To unsubscribe from this list send email to JAVA400-L-UNSUB@midrange.com. | Questions should be directed to the list owner: joe@zappie.net +---
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.