Forums Register Login

Passing object to JList

+Pie Number of slices to send: Send
Hi everyone.

I want to display objects in a JList then remove an item when a button is clicked the item "bought" is bought, and the item is then removed from the list. I then want to pass the object as a variable to a method in a different class, which will remove it from an arraylist.

So far here's the relevant code:





+Pie Number of slices to send: Send
What's your question ?
+Pie Number of slices to send: Send
How do i pass a list of object "bought" to the JList and have it's title getName displayed.

How do i remove the item from the JList

Can I then pass the item to the method itemBought() which will the remove it from an ArrayList?
+Pie Number of slices to send: Send
Notice that the word JList in your post has been turned into a link. Following that link should get you started.
I am mighty! And this is a mighty small ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 1811 times.
Similar Threads
Error can't find class
MZs Notes - Pg 159
problems when using a datable within a form: currently my code is clunky
JPA criteriaBuilder method not found
update a JList based on an Array
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 13:31:12.