Results 1 to 4 of 4
Thread: Problem With jList
- 06-02-2010, 01:58 PM #1
Member
- Join Date
- Apr 2010
- Posts
- 51
- Rep Power
- 0
Problem With jList
Hello every one I want to add element in jList by returning database and collect in a String array.
but wahen i add element like jList.addElement(string[i]);
it gives error. here i is for loop variable.
The same thing work fine with jComboBox;.addItem(string[i]);
Please tell me where is the problem and what is method i have to use.
Thank you.
- 06-02-2010, 09:23 PM #2
I dont know much about the JList, I've never used it.
I did have a brief look at the java docs, and it looks like you should add the list of strings in the constructor:
No need for any loops :)Java Code:JList aList = new JList (string[]);
Alternatively it looks like you could use
As I said I've never used JList before so I may be wrong.Java Code:aList.setListData(string[]);
Hope this helps!
Berkeleybross
-
- 06-03-2010, 06:28 AM #4
Member
- Join Date
- Apr 2010
- Posts
- 51
- Rep Power
- 0
Similar Threads
-
[SOLVED] JList( Vector ) Display problem
By logicbug in forum AWT / SwingReplies: 4Last Post: 03-21-2009, 02:28 PM -
JList
By pinks_70986 in forum New To JavaReplies: 1Last Post: 02-12-2009, 08:36 AM -
JList and records, what to do to solve the problem
By willemjav in forum Java AppletsReplies: 10Last Post: 06-11-2008, 02:28 PM -
Problem with JComboBox and Jlist
By java_fun2007 in forum New To JavaReplies: 2Last Post: 05-07-2008, 08:58 PM -
JList problem
By zizou147 in forum Advanced JavaReplies: 1Last Post: 04-17-2008, 08:50 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks