| Author |
from list awt to JList swing
|
paul beppe
Ranch Hand
Joined: Aug 09, 2012
Posts: 51
|
|
hi i have create program in awt...now i want create in swing...i have one problem
i have this code in awt:
i have problem in:
String selectedSong = getPlayList2().getItem(selectedIndex);
how to write in swing???
i'm trying from long time.... :-(
|
 |
Darryl Burke
Bartender
Joined: May 03, 2008
Posts: 4163
|
|
paul, please BeForthrightWhenCrossPostingToOtherSites
http://www.java-forums.org/awt-swing/62806-list-awt-jlist-swing.html
|
luck, db
There are no new questions, but there may be new answers.
|
 |
K. Tsang
Ranch Hand
Joined: Sep 13, 2007
Posts: 1219
|
|
Hi paul
Have you looked at the JList javadoc for clues? What does the getPlayerList2() return?
|
K. Tsang JavaRanch SCJP5 SCJD/OCM-JD
|
 |
paul beppe
Ranch Hand
Joined: Aug 09, 2012
Posts: 51
|
|
yes i Have you looked at the JList javadoc....
but i don't understand....how to write in swing...
help me please!!!
my problem is "getItem"
i don't no how to convert in swing
|
 |
paul beppe
Ranch Hand
Joined: Aug 09, 2012
Posts: 51
|
|
|
getPlayList2() return one file from database....
|
 |
K. Tsang
Ranch Hand
Joined: Sep 13, 2007
Posts: 1219
|
|
paul beppe wrote:getPlayList2() return one file from database....
There are several ways but to keep it simple, populate the getPlayList2() into an array. Now you will also need to loop through the database to while populating your array. Once you have this array your JList is self explanatory.
You may also want to explore ListModel, which if defined properly should give you more control of your data.
|
 |
 |
|
|
subject: from list awt to JList swing
|
|
|