Dirty menu selection handling

class MyFrame extends Frame {
    public boolean action(Event evt, Object what) {
        if (evt.target instanceof MenuItem) {
            if (evt.arg.equals("Quit")) {
                // handle Quit button
            } else
            if (evt.arg.equals("New")) {
                // handle New button
            }
            return true;
        }
        return super.action(evt, what);
    }
}
This requires that Frame carries the application logic for menus.


Slide 57