This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes Jlist problems Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Jlist problems" Watch "Jlist problems" New topic
Author

Jlist problems

mizo halwagy
Greenhorn

Joined: Dec 05, 2007
Posts: 3
hi
i have problems with jlist to add items and deal with it and the main problem that i want to add these items from database
how can add items at jlist from database
i mean i don't want to add the items manualy ,i only want when i access to data base i the data come from to data base and add to jlist automaticaly
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41020
    
  43
There is no way to automatically construct a JList from a DB query. You'll need to iterate through the ResultSet and store the elements in the JList one by one. What is the reason for not wanting to do that?


Ping & DNS - my free Android networking tools app
mizo halwagy
Greenhorn

Joined: Dec 05, 2007
Posts: 3
thanks but can you send me the code of this problem
and how can i communicate with you
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 37874
    
  22
Originally posted by mizo halwagy:
thanks but can you send me the code of this problem
and how can i communicate with you

Please don't try to get answers away from the forum. The idea is that when you show us the problem and somebody helps you find the solution, then everybody can learn from your experience.
[ December 09, 2007: Message edited by: Campbell Ritchie ]
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Jlist problems
 
Similar Threads
GridBag Layout
how to pass the model to JList in netbeans5?
JList maximum size?
populate jList with database values....
JList setListData problem