| Author |
JList error
|
Rob Brew
Ranch Hand
Joined: Jun 23, 2011
Posts: 88
|
|
Hi all.
Getting there slowly but miffied about this:
Thanks in advance.
Rob.
|
 |
fred rosenberger
lowercase baba
Bartender
Joined: Oct 02, 2003
Posts: 9939
|
|
I'm not 100% sure, but I think when you do
import javax.swing.*;
you only get the first level below "javax.swing"
However, the ListSelectionEvent is two levels below:
javax.swing.event.ListSelectionEvent
So I would either explicitly import that, or import this:
import javax.swing.event.*;
note: I have not tried this, it's a somewhat educated guess.
|
Never ascribe to malice that which can be adequately explained by stupidity.
|
 |
Rob Brew
Ranch Hand
Joined: Jun 23, 2011
Posts: 88
|
|
|
Tried what you suggested fred but still get the same error.
|
 |
Dielson Sales
Greenhorn
Joined: Feb 02, 2011
Posts: 4
|
|
Rob Brew wrote:Tried what you suggested fred but still get the same error.
It must be another error. Could you post the error again, when you try to import everything?
|
 |
Rob Brew
Ranch Hand
Joined: Jun 23, 2011
Posts: 88
|
|
Sure.
|
 |
fred rosenberger
lowercase baba
Bartender
Joined: Oct 02, 2003
Posts: 9939
|
|
|
So how is going from 3 errors to 2 errors the same thing?
|
 |
Rob Brew
Ranch Hand
Joined: Jun 23, 2011
Posts: 88
|
|
Sorry Fred, will repost the code.
|
 |
Dielson Sales
Greenhorn
Joined: Feb 02, 2011
Posts: 4
|
|
Think you're getting this error because you're implementing ActionListener in you class ListBoxClick, and the method addListSelectionListener asks for a ListSelectionListener. Both extend EventListener, but they are different.
You should implement ListSelectionListener and override the method valueChanged.
|
 |
Rob Brew
Ranch Hand
Joined: Jun 23, 2011
Posts: 88
|
|
Sorted, thanks Dielson
|
 |
 |
|
|
subject: JList error
|
|
|