This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes from list awt to JList swing Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "from list awt to JList swing" Watch "from list awt to JList swing" New topic
Author

from list awt to JList swing

paul beppe
Ranch Hand

Joined: Aug 09, 2012
Posts: 86
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: 4523
    
    5

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
Bartender

Joined: Sep 13, 2007
Posts: 2242
    
    7

Hi paul

Have you looked at the JList javadoc for clues? What does the getPlayerList2() return?


K. Tsang JavaRanch SCJP5 SCJD/OCM-JD OCPJP7 OCPWCD5
paul beppe
Ranch Hand

Joined: Aug 09, 2012
Posts: 86
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: 86
getPlayList2() return one file from database....
K. Tsang
Bartender

Joined: Sep 13, 2007
Posts: 2242
    
    7

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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: from list awt to JList swing
 
Similar Threads
how to pass JavaScript value to JSP
How to use tables in AWT ?
Table Object
How can I call my obj in another program?
pizza ordering system