Need help with ActionEvent/ItemEvent
I am trying to call the displayJButtonActionPerformed(evt) from 8 different JCheckBox methods similar to the one I posted below. I want to do this because it is more efficient and will cut down on some code. I have used this in the past but now that I am using an Actionevent and and ItemEvent I am getting an error when using (evt) as a a parameter, when trying to use displayJButtonActionPerformed(evt) in the addAnotherJCheckBoxItemStateChanged. I am using netbeans GUi editor so it created the methods for me when I select the acton I want to use. The error says....
Required: java.awt.event.ActionEvent
Found: java.awt.event.ItemEvent
What Can I do to fix this?
private void displayJButtonActionPerformed(java.awt.event.Actio nEvent evt) {
Invoice showInvoice = new Invoice();
showInvoice.calculate();
}
private void addAnotherJCheckBoxItemStateChanged(java.awt.event .ItemEvent evt) {
if (addAnotherJCheckBox.isSelected())
{
Invoice.isaddOneChecked = true;
}
else
Invoice.isaddOneChecked = false;
Invoice showInvoice = new Invoice();
showInvoice.calculate();
}