how to close the applet in java code?

Problem in java Applet code, please help?

  • I have a problem, an error on my : public void MenuChoice() (ActionEvent e) the error is on the brackets surrounding the ActionEvent e also I wanted to know how it was possible to use multiple methods under an if statement, my applet is supposed to show two buttons, a start and display high scores, under start it will run the ping pong game but I get an error at the open { of the if and at the else if statement, what can I do? this is not homework or assignment work I assure you, I am trying to learn java on my own and any help would be much appreciated. i understand pictures would make it a lot easier so if you think you can help but need to see an image please feel free to email me at [email protected]

  • Answer:

    Remove the empty set of parentheses. I'm not sure about the other question, it could be anything. Maybe post some of the code around the if statement.

Ahren Posthumus at Yahoo! Answers Visit the source

Was this solution helpful to you?

Other answers

Your class needs IMPLEMENT ACTIONLISTENER public class AppletNameHere implements ActionListener When you created the button that was going to need to use the code, the button needs to be given the path. startButton = new Button("Start"); startButton.addActionListener(this); Now your problem: public void MenuChoice(ActionEvent e) { code that runs when you click start; }

Hieu N.

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.