|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.mozdev.MacroTracker.toolkit.MMenuBuilder
public class MMenuBuilder
This class ia a menu builder class that gives you an easy way to create a JMenuBar without a bunch of code.
The methods provide a simple interface to create a menubar, and action listeners are added through the methods to make the menu items do stuff.
Constructor Summary | |
---|---|
MMenuBuilder()
|
Method Summary | |
---|---|
void |
addMenu(java.lang.String aName,
char aMnemonic)
Add a menu to the menubar. |
void |
addMenuItem(java.lang.String aMenu,
java.lang.String aName,
char aMnemonic)
Adds a menu item to a menu added. |
void |
addMenuItem(java.lang.String aMenu,
java.lang.String aName,
char aMnemonic,
java.awt.event.ActionListener aListener)
Adds a menu item to a menu added. |
void |
addMenuItem(java.lang.String aMenu,
java.lang.String aName,
char aMnemonic,
java.awt.event.ActionListener aListener,
char aAccelerator)
Adds a menu item to a menu added. |
void |
addMenuItem(java.lang.String aMenu,
java.lang.String aName,
char aMnemonic,
java.awt.event.ActionListener aListener,
java.lang.String aImageURI)
Adds a menu item to a menu added. |
void |
addMenuItem(java.lang.String aMenu,
java.lang.String aName,
char aMnemonic,
java.awt.event.ActionListener aListener,
java.lang.String aImageURI,
char aAccelerator)
Adds a menu item to a menu added. |
void |
addSeparator(java.lang.String aMenu)
Adds a separator to the end of the menu. |
void |
addSubMenu(java.lang.String aMenu,
java.lang.String aName,
char aMnemonic)
Adds a sub menu (basically a menuitem that can have sub-menuitems) to a menu. |
javax.swing.JMenuBar |
getMenubar()
Returned the MenuBar generated by the class. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MMenuBuilder()
Method Detail |
---|
public void addMenu(java.lang.String aName, char aMnemonic)
aName
- The name of the menu to add to the menubar.aMnemonic
- The letter the user can hit when the menubar is highlighted to
open the menu.public void addMenuItem(java.lang.String aMenu, java.lang.String aName, char aMnemonic)
aMenu
- The name of the menu you want to add this menuitem to (it can be
a sub menu or a main menu).aName
- The name of the menu item.aMnemonic
- The letter the user can hit when the menu is opened to start
the menus action.public void addMenuItem(java.lang.String aMenu, java.lang.String aName, char aMnemonic, java.awt.event.ActionListener aListener)
aMenu
- The name of the menu you want to add this menuitem to (it can be
a sub menu or a main menu).aName
- The name of the menu item.aMnemonic
- The letter the user can hit when the menu is opened to start
the menus action.aListener
- The ActionListener to run when the menu item is clicked.public void addMenuItem(java.lang.String aMenu, java.lang.String aName, char aMnemonic, java.awt.event.ActionListener aListener, char aAccelerator)
aMenu
- The name of the menu you want to add this menuitem to (it can be
a sub menu or a main menu).aName
- The name of the menu item.aMnemonic
- The letter the user can hit when the menu is opened to start
the menus action.aListener
- The ActionListener to run when the menu item is clicked.aAccelerator
- The hot key of this menu item's action.public void addMenuItem(java.lang.String aMenu, java.lang.String aName, char aMnemonic, java.awt.event.ActionListener aListener, java.lang.String aImageURI, char aAccelerator)
aMenu
- The name of the menu you want to add this menuitem to (it can be
a sub menu or a main menu).aName
- The name of the menu item.aMnemonic
- The letter the user can hit when the menu is opened to start
the menus action.aListener
- The ActionListener to run when the menu item is clicked.aAccelerator
- The hot key of this menu item's action.public void addMenuItem(java.lang.String aMenu, java.lang.String aName, char aMnemonic, java.awt.event.ActionListener aListener, java.lang.String aImageURI)
aMenu
- The name of the menu you want to add this menuitem to (it can be
a sub menu or a main menu).aName
- The name of the menu item.aMnemonic
- The letter the user can hit when the menu is opened to start
the menus action.aListener
- The ActionListener to run when the menu item is clicked.aImageURI
- The URI of the image to display in the menu item.public void addSeparator(java.lang.String aMenu)
aMenu
- The menu to add the separator to the end to.public void addSubMenu(java.lang.String aMenu, java.lang.String aName, char aMnemonic)
You can add items to this new submenu using the addMenuItem() function.
aMenu
- The name of the menu you want to add this submenuitem to (it can be
a sub menu or a main menu).aName
- The name of the menu item.aMnemonic
- The letter the user can hit when the menu is opened to start
the menus action.public javax.swing.JMenuBar getMenubar()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |