![]() |
||
![]() |
![]() Alden Hosting provides professional, efficient, and reliable business-class Web hosting services to small- and medium-sized businesses. |
|
|
JAVA, JSP, SERVLETS, TOMCAT, SERVLETS MANAGER, |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Constructor or Method | Purpose |
|---|---|
| JMenuBar() | Creates a menu bar. |
| JMenu add(JMenu) | Creates a menu bar. |
|
void setJMenuBar(JMenuBar) JMenuBar getJMenuBar() (in JApplet,
JDialog,
JFrame,
JInternalFrame,
JRootPane)
|
Sets or gets the menu bar of an applet, dialog, frame, internal frame, or root pane. |
| Constructor or Method | Purpose |
|---|---|
|
JMenu() JMenu(String) JMenu(Action) |
Creates a menu.
The string specifies the text to display for the menu.
The Action specifies the text
and other properties of the menu (see
How to Use Actions).
|
|
JMenuItem add(JMenuItem)
JMenuItem add(String) |
Adds a menu item to the current end of the menu.
If the argument is a string,
then the menu automatically creates a JMenuItem object
that displays the specified text.
Version Note: Before 1.3, the only way to associate an |
| void addSeparator() | Adds a separator to the current end of the menu. |
|
JMenuItem insert(JMenuItem, int)
void insert(String, int) void insertSeparator(int) |
Inserts a menu item or separator into the menu
at the specified position.
The first menu item is at position 0,
the second at position 1, and so on.
The JMenuItem
and String arguments are treated the same
as in the corresponding add methods.
|
|
void remove(JMenuItem) void remove(int) void removeAll() |
Removes the specified item(s) from the menu. If the argument is an integer, then it specifies the position of the menu item to be removed. |
| Constructor or Method | Purpose |
|---|---|
|
JPopupMenu() JPopupMenu(String) |
Creates a popup menu. The optional string argument specifies the title that a look and feel might display as part of the popup window. |
|
JMenuItem add(JMenuItem)
JMenuItem add(String) |
Adds a menu item to the current end of the popup menu.
If the argument is a string,
then the menu automatically creates a JMenuItem object
that displays the specified text.
Version Note: Before 1.3, the only way to associate an |
| void addSeparator() | Adds a separator to the current end of the popup menu. |
| void insert(Component, int) | Inserts a menu item into the menu
at the specified position.
The first menu item is at position 0,
the second at position 1, and so on.
The Component argument specifies
the menu item to add.
|
|
void remove(int) void removeAll() |
Removes the specified item(s) from the menu. If the argument is an integer, then it specifies the position of the menu item to be removed. |
| static void setLightWeightPopupEnabled(boolean) | By default, Swing implements a menu's window
using a lightweight component.
This can cause problems if you use any heavyweight components
in your Swing program,
as described in Bringing Up a Popup Menu.
(This is one of several reasons to avoid using heavyweight components.)
As a workaround, invoke
JPopupMenu.setLightWeightPopupEnabled(false).
|
| void show(Component, int, int) | Display the popup menu at the specified x,y position (specified in that order by the integer arguments) in the coordinate system of the specified component. |
| Constructor or Method | Purpose |
|---|---|
|
JMenuItem() JMenuItem(String) JMenuItem(Icon) JMenuItem(String, Icon) JMenuItem(String, int) JMenuItem(Action) |
Creates an ordinary menu item.
The icon argument, if present,
specifies the icon that the menu item should display.
Similarly, the string argument
specifies the text that the menu item should display.
The integer argument specifies the keyboard mnemonic
to use. You can specify any of the relevant VK
constants defined in the
KeyEvent class.
For example, to specify the A key,
use KeyEvent.VK_A.
The constructor with the |
|
JCheckBoxMenuItem() JCheckBoxMenuItem(String) JCheckBoxMenuItem(Icon) JCheckBoxMenuItem(String, Icon) JCheckBoxMenuItem(String, boolean) JCheckBoxMenuItem(String, Icon, boolean) |
Creates a menu item that looks and acts like a check box.
The string argument, if any, specifies
the text that the menu item should display.
If you specify true for the boolean argument,
then the menu item is initially selected (checked).
Otherwise, the menu item is initially unselected.
|
|
JRadioButtonMenuItem() JRadioButtonMenuItem(String) JRadioButtonMenuItem(Icon) JRadioButtonMenuItem(String, Icon) JRadioButtonMenuItem(String, boolean) JRadioButtonMenuItem(Icon, boolean) JRadioButtonMenuItem(String, Icon, boolean) |
Creates a menu item that looks and acts like a radio button.
The string argument, if any, specifies
the text that the menu item should display.
If you specify true for the boolean argument,
then the menu item is initially selected.
Otherwise, the menu item is initially unselected.
|
|
void setState(boolean) boolean getState() (in JCheckBoxMenuItem)
|
Set or get the selection state of a check box menu item. |
| void setEnabled(boolean) | If the argument is true, enable the menu item. Otherwise, disable the menu item. |
| void setMnemonic(int) | Set the mnemonic that enables keyboard navigation to
the menu or menu item. Use one of the VK
constants defined in the KeyEvent class.
|
| void setAccelerator(KeyStroke) | Set the accelerator that activates the menu item. |
| void setActionCommand(String) | Set the name of the action performed by the menu item. |
|
void addActionListener(ActionListener) void addItemListener(ItemListener) |
Add an event listener to the menu item. See Handling Events from Menu Items for details. |
| void setAction(Action) | Set the Action
associated with the menu item.
See
How to Use Actions for details.
|
Many of the preceding methods are inherited from
AbstractButton.
See The Button API
for information about other useful methods
that AbstractButton provides.
|
|
Menus are used in a few of our examples.
Example Where Described Notes MenuLookDemoThis section (Creating Menus) A simple example that creates all kinds of menus except popup menus, but doesn't handle events from the menu items. MenuDemoThis section (Handling Events from Menu Items) Adds event handling to MenuLookDemo.PopupMenuDemoThis section (Bringing Up a Popup Menu) Adds popup menus to MenuDemo.MenuGlueDemoThis section (Customizing Menu Layout) Demonstrates affecting menu layout by adding an invisible components to the menu bar. MenuLayoutDemoThis section (Customizing Menu Layout) Implements sideways-opening menus arranged in a vertical menu bar. MenuSelectionManagerDemo— Adds highlight detection to MenuDemo. To see this feature, click a menu and then move the mouse over any menu item or submenu. Once per second, the text area will be updated with information about the currently highlighted menu item, not to be confused with the menu item that the user eventually chooses. This demo uses the default MenuSelectionManager, which tracks the state of the menu hierarchy.ActionDemoHow to Use Actions Uses Actionobjects to implement menu items that duplicate functionality provided by tool bar buttons.Framework— Brings up multiple identical frames, each with a menu in its menu bar. InternalFrameDemoHow to Use Internal Frames Uses a menu item to create windows. DragColorTextFieldDemoIntroduction to Drag and Drop and Data Transfer Sets up menu items for cut/copy/paste. DragPictureDemoIntroduction to Drag and Drop and Data Transfer Sets up menu items for cut/copy/paste with a non-text component.
Alden Hosting offers private JVM (Java Virtual Machine), Java Server Pages (JSP), Servlets, and Servlets Manager with our Web Hosting Plans WEB 4 PLAN and WEB 5 PLAN , WEB 6 PLAN .
At Alden Hosting we eat and breathe Java! We are the industry leader in providing affordable, quality and efficient Java web hosting in the shared hosting marketplace. All our sites run on our Java hosing platform configured for optimum performance using Java 1.6, Tomcat 6.0.X, MySQL 5.0.x, Apache 2.2.xx and web application frameworks such as Struts, Hibernate, Cocoon, Ant, etc.
We offer only one type of Java hosting - Private Tomcat. Hosting accounts on the Private Tomcat environment get their very own Tomcat server. You can start and re-start your entire Tomcat server yourself.
![]() |
|
http://alden-servlet-Hosting.com
JSP at alden-servlet-Hosting.com
Servlets at alden-servlet-Hosting.com
Servlet at alden-servlet-Hosting.com
Tomcat at alden-servlet-Hosting.com
MySQL at alden-servlet-Hosting.com
Java at alden-servlet-Hosting.com
sFTP at alden-servlet-Hosting.com
http://alden-tomcat-Hosting.com
JSP at alden-tomcat-Hosting.com
Servlets at alden-tomcat-Hosting.com
Servlet at alden-tomcat-Hosting.com
Tomcat at alden-tomcat-Hosting.com
MySQL at alden-tomcat-Hosting.com
Java at alden-tomcat-Hosting.com
sFTP at alden-tomcat-Hosting.com
http://alden-sftp-Hosting.com
JSP at alden-sftp-Hosting.com
Servlets at alden-sftp-Hosting.com
Servlet at alden-sftp-Hosting.com
Tomcat at alden-sftp-Hosting.com
MySQL at alden-sftp-Hosting.com
Java at alden-sftp-Hosting.com
sFTP at alden-sftp-Hosting.com
http://alden-jsp-Hosting.com
JSP at alden-jsp-Hosting.com
Servlets at alden-jsp-Hosting.com
Servlet at alden-jsp-Hosting.com
Tomcat at alden-jsp-Hosting.com
MySQL at alden-jsp-Hosting.com
Java at alden-jsp-Hosting.com
sFTP at alden-jsp-Hosting.com
http://alden-java-Hosting.com
JSp at alden-java-Hosting.com
Servlets at alden-java-Hosting.com
Servlet at alden-java-Hosting.com
Tomcat at alden-java-Hosting.com
MySQL at alden-java-Hosting.com
Java at alden-java-Hosting.com
sFTP at alden-java-Hosting.com
JSP
Servlets
Tomcat
mysql
Java
JSP
Servlets
Tomcat
mysql
Java
JSP
Servlets
Tomcat
mysql
Java
JSP
Servlets
Tomcat
mysql
Java
JSP at JSP.aldenWEBhosting.com
Servlets at servlets.aldenWEBhosting.com
Tomcat at Tomcat.aldenWEBhosting.com
mysql at mysql.aldenWEBhosting.com
Java at Java.aldenWEBhosting.com
Web Hosts Portal
Web Links
Web Links
Web Hosting
JSP Solutions Web Links
JSP Solutions Web Hosting
Servlets Solutions Web Links
Servlets Solutions Web Hosting
Web Links
Web Links
.
.
.
.
.
.
.
.
.
.
jsp hosting
servlets hosting
web hosting
web sites designed
cheap web hosting
web site hosting
myspace web hosting