Cannot invoke set Double(Double) on the primitive type double

FleemaPat

New Member
Okay, I'm pretty bad at java (honestly I hate programming, I much prefer networking). Anyway, since this is for university I can't actually share much of the code without being done for academic misconduct, although I'm free to ask for help.I have a JList with a bunch of names in it, and an array for the value of those names\[code\]final Double[] filmcost = { 5.00, 5.50, 7.00, 6.00, 5.00 };\[/code\]What I want to do is when someone selects something from the list, it assigns the value to a variable (it also sets a text box to a string from another array, but that works fine). So I've got my variable \[code\]protected double filmCost;\[/code\]and here's the ListSelectionListener \[code\]filmList.addListSelectionListener(new ListSelectionListener() { public void valueChanged(ListSelectionEvent evt) { filmCost.setDouble(filmcost[filmList.getSelectedIndex()]); } });\[/code\]However, it's complaining that it "Cannot invoke set Double(Double) on the primitive type double". I feel like the solution is really simple, and I'm just being a retard but I've been stuck on this for over an hour now.
 
Back
Top