Why do i get this error?

this is the snippet that produces an error saying :

')' expected
';' expected
not a statement
cannot find symbol
symbol : variable ActionEvent

The snippet :

private void jMenuItem5ActionPerformed(java.awt.event.ActionEvent evt) {
    JFileChooser chooseToAdd = new JFileChooser();
    int option = chooseToAdd.showOpenDialog(this);
    if( option == JFileChooser.APPROVE_OPTION ) {
        nameOfAudioFile = chooseToAdd.getSelectedFile().getAbsolutePath();
        //clonejTree1ValueChanged( TreeSelectionEvent evt );
        tester(java.awt.event.ActionEvent evt);
    }
}

private void tester(java.awt.event.ActionEvent evt) {
    System.out.println("tester");
}

Is there any syntax error ?

Answer:1

This line is wrong:

tester(java.awt.event.ActionEvent evt);

Here you should pass an object of the type ActionEvent.

So it should be something like this:

tester(evt);
Answer:2

Call

tester(evt); 

instead of

tester(java.awt.event.ActionEvent evt);

You shouldn't define the type there, it is already known. Method invocation syntax is not the same as method definition.

Answer:3

If you call a method, you don't have to provide the type of the parameter. So in line 6 of the snippet it only should be

tester(evt);
Answer:4

I know that a child cannot reduce the visibility of a non-static method and I understand why it is so. I've read however that "static method can be hidden through its redeclaration". I however do not ...

I am using swing to build a GUI with 4 JPanels inside a JPanel using the BorderLayout manager: A row of labels A column of JButtons A display area (it is a class that extends JPanel and has nothing ...

Possible Duplicate: Update more than one row atomically I have a set of data-chunks stored in a noSQL database. To update the data I need to: fetch (get) update data write (put) (no direct ...

I'm trying to build an HTTP request manually (as a string) and send it over a TCP socket, this is what I'm trying to do: import java.io.BufferedReader; import java.io.IOException; import java.io....