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,525
  • 20
  • 134
  • 319
Eric Pauley
  • 1,709
  • 1
  • 20
  • 30

1 Answers1

3

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

MByD
  • 135,866
  • 28
  • 264
  • 277
  • 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