File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Swing / AWT / SWT and the fly likes Copy JList multiselect to another JList Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Copy JList multiselect to another JList" Watch "Copy JList multiselect to another JList" New topic
Author

Copy JList multiselect to another JList

paul beppe
Ranch Hand

Joined: Aug 09, 2012
Posts: 86
hi!!!

i have one JList and show all resordset....

i want selected rows and copy another JList

my code is:



i don't understand where is error....

help me please...
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18987
    
    8

You say there is an error: how do you know that?
paul beppe
Ranch Hand

Joined: Aug 09, 2012
Posts: 86
because don't copy in another jlist!!!

i want copy from "listEdit" to "listMdel"

don't exit nothing error but don't copy!!!

i hope you unsterstand me!!!

Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18987
    
    8

So have you done any debugging at all? Is the line of code inside the "rs.next()" loop ever called? Don't make us guess, tell us what is happening in that code. Remember that it's only a code fragment so we have no way of running it and finding out what it does.
paul beppe
Ranch Hand

Joined: Aug 09, 2012
Posts: 86
do you want all code for to see where is the problem???
paul beppe
Ranch Hand

Joined: Aug 09, 2012
Posts: 86
thi is all code:


paul beppe
Ranch Hand

Joined: Aug 09, 2012
Posts: 86
when i click to copy....

exit this message:

Error: QueryResult cannot be cast to java.lang.String

this error...for listModel or listEdit???
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18987
    
    8

Obviously that isn't going to help because you are using a database. So, no. What you should do now is to ShowSomeEffort ( <-- follow that link and read it). After you read that, see if you can answer the question I already asked.
paul beppe
Ranch Hand

Joined: Aug 09, 2012
Posts: 86
i understand....

but....

if i write:


the select is from JComboBox the program copy all file in another JList.....

but i write:


error!!!

this problem i don't understand.....
paul beppe
Ranch Hand

Joined: Aug 09, 2012
Posts: 86
with JCombobox i haven't problems!!!

Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18987
    
    8

paul beppe wrote:error!!!


Again... How do you know there is an error? Let me refer you to another of our FAQ pages: TellTheDetails.
Ranganathan Kaliyur Mannar
Bartender

Joined: Oct 16, 2003
Posts: 1096
    
  10

By error, do you mean compilation error?
are you using Java 1.7?
how are you declaring your JList and JComboBox variables?


Ranga.
SCJP 1.4, OCMJEA/SCEA 5.0.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Copy JList multiselect to another JList