Next: Adding Actions to Containers
Up: Swing Component Basics
Previous: Swing Component Basics
Actions are a popular addition to Swing
- Bundles commonly used procedure and properties in a common
Class
- Especially useful when application needs to call a function from
multiple sources e.g. Save data to disk from Menu Item, Save
Button, Dialog action (after a quit) etc. (see Section
for a full
program example)
To see how this multiple action can be achieved consider the following:
- We create a Save Menu Item
- We create a ToolBar Button
- Both invoke the same save event
Action being invoked by two events
Dave Marshall
4/14/1999