0

My friend is having trouble adding an action when a menu is opened. He won't ask for help from anyone so here I am.

The project is a tetris game. We need a system to run a pause method whenever a menu is opened and an unpause method when it is closed.

Any suggestions?

mKorbel
  • 109,107
  • 18
  • 130
  • 305
Eric Pauley
  • 1,651
  • 1
  • 19
  • 29

1 Answers1

3

Assuming you are using Swing - Take a look at addMenuListener and addActionListener.

MByD
  • 133,244
  • 25
  • 260
  • 270
  • See also this [example](http://stackoverflow.com/questions/4038605/swing-link-toggle-buttons-together-with-a-button-group-along-with-corresponding/4039359#4039359). – trashgod May 22 '11 at 00:41