I have:
class CustomerActionListener implements ActionListener
{
@Override
public void actionPerformed(ActionEvent event)
{
JComboBox cb = (JComboBox)event.getSource();
.. do something
}
}
Which causes the following compiler warning in jdk7:
JComboBox is a raw type. References to generic type JComboBox should be parameterized
I've tried to parameterize it to such that:
JComboBox<String> cb = (JComboBox<String>)event.getSource();
But this still leaves the following compiler warning:
Type safety: Unchecked cast from Object to JComboBox
Therefore I'm not sure how to eliminate the compiler warnings...