× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.


  • Subject: RE: IMulticolumnListbox class
  • From: "Xu, Weining" <Weining.Xu@xxxxxxx>
  • Date: Tue, 5 Jun 2001 08:52:23 -0400

Title: RE: IMulticolumnListbox class

Thanks PC2,

I couldn't find the article on the web.  I think that I have to subscribe it in order to read that article.

-----Original Message-----
From: Clapham, Paul [mailto:pclapham@core-mark.com]
Sent: Monday, June 04, 2001 5:17 PM
To: JAVA400-L@midrange.com
Subject: RE: IMulticolumnListbox class


JList?  You want a JTable for that.  If you're looking for something to put
a database query into a JTable, the June 2001 issue of Java Pro magazine
(http://www.java-pro.com) has an article that describes a reusable way of
doing that.

PC2

-----Original Message-----
From: Xu, Weining [mailto:Weining.Xu@AIG.com]
Sent: June 4, 2001 13:18
To: 'JAVA400-L@midrange.com'
Subject: RE: IMulticolumnListbox class


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.

+---
| 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 thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.