View Single Post
Old 10-12-2009, 16:43   #2
banryu79
Senior Member
 
L'Avatar di banryu79
 
Iscritto dal: Oct 2007
Città: Padova
Messaggi: 4131
Quote:
Originariamente inviato da federico100mt Guarda i messaggi
insomma, un giro di parole. Io riesco a selezionarle, a stampare il loro contenuto, aggiungo gli elementi in un Vector(object) che poi passo all'altra jlist ma non mi risputa nessun risultato sulla GUI.
Il Vector che cos'è? Suppongo sia l'oggetto che passi come model durante la costruzione dell'altra JList.
Se è così, sappi che dietro le quinte con quel Vector viene creato per te un DefaultListModel *immutabile* per la JList, quindi add e remove fanno cilecca...

Quote:
Other JList constructors let you initialize a list from a Vector or from an object that adheres to the ListModel interface. If you initialize a list with an array or vector, the constructor implicitly creates a default list model. The default list model is immutable — you cannot add, remove, or replace items in the list. To create a list whose items can be changed individually, set the list's model to an instance of a mutable list model class, such as an instance of DefaultListModel. You can set a list's model when you create the list or by calling the setModel method. See Adding Items to and Removing Items from a List for an example.
Tratto da questa pagina.
__________________

As long as you are basically literate in programming, you should be able to express any logical relationship you understand.
If you don’t understand a logical relationship, you can use the attempt to program it as a means to learn about it.
(Chris Crawford)
banryu79 è offline   Rispondi citando il messaggio o parte di esso