Creating sub menu's under Abstract Action.

Folks,
I am trying to create a sub-menu under abstract actions.
But when I run the application,I can only see 'Create New Positions' menu item;
and cannot view/invoke the sub menu options(ie Create Position One/Two).
Is there a way to create sub menu's under the main action menu? (in the code below please)
Thanks,
final ArrayList<Action> actions = new ArrayList<Action>();
actions.add(new AbstractAction("Create New Positions") {
     public void actionPerformed(ActionEvent e) {
               // Sub Menu options          
               actions.add(new AbstractAction("Create Position One") {
               @Override
               public void actionPerformed(ActionEvent e) {
               // Code to create position one                         
     public void actionPerformed(ActionEvent e) {
               // Sub Menu options          
               actions.add(new AbstractAction("Create Position Two") {
               @Override
               public void actionPerformed(ActionEvent e) {
               // Code to create position two                    
});

Hi Thomas.behr
I tried as you suggested :
final ArrayList<Action> actions = new ArrayList<Action>();
actions.add(new AbstractAction("Position Creation..."){
public void actionPerformed(ActionEvent e) {
                        JMenu PositionMenu = new JMenu(new AbstractAction("Create Position one"){
          @Override
          public void actionPerformed(ActionEvent e) {
               // TODO Auto-generated method stub
               // actions.add( PositionMenu).... as action expects an Action
{code}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

Similar Messages

  • Reg: Creating sub menu for a concurrent program under menu on the Menu bar

    Hi all,
    I would like to know, how we can create a sub menu for a conc. program under a sub menu on the Menu Bar ?
    Thanks In Advance.
    Regards,
    Neeti

    It is a 2 step process. First, enable a new menu entry, which when called will fire a user-named trigger, where the call to the concurrent programs form is the executed. How to do it depends on the release. Previous to 11.5.10, this has to be done trough custom.pll, and 11i10 an r12 with forms personalization. Documentation and examples exists for both cases, have a look on metalink.

  • Creating Sub Menu's

    I have made a basic bit of flash where there is text as
    buttons, they change colour when the cursor goes over them. With
    some of them, I want secondary buttons to appear below (sub
    menu)...how do I do this? Many thanks in advance!

    Here you go, thats one way:
    http://www.webwasp.co.uk/tutorials/A_IntAct-03-menus/index.php
    I personally would look into the menuBar component and play
    with the colors, just do a search for menuBar under componens
    help

  • How to create a menu item under Tools menu using menu-hook in extension.xml

    I am able to do it in FILE menu (FILE_MENU_ID) and View menu (VIEW_MENU_ID). But how to do it under "Tools" menu? specifying TOOLS_MENU_ID or MENU_TOOLS in extension.xml menu-hook does not work.
    Thanks
    Sanjiv

    That's great. I'd love to jump into j-script and learn all about it, what it can do, what it's limitations are.... But I'm actually just looking to use the program as it functions (or should) out of the box.
    This feature was accessible in Acro 8. I don't think that java should be necessary to perform this task. But maybe it is. Is anyone else able to use the "execute menu item" action? Because my build (acrobat 9.0 pro extended)only displays a blank selection dialog.
    Thanks for the reply Geo

  • How to create a sub menu for the transaction se38

    Hi All,
    I have created menu item in se38 using menu exit.
    By using the enhancement SEU00002 .
    That menu item is displayed under utilities menu bar.
    But i am unable to create sub menu for that.
    My requirement is to create sub menu to the custom menu item.
    How can we create a sub menu to the transaction se38.

    Hi,
    it looks like that user exit SEU00002 offers only one extra function +CUS. This function then calls FM EXIT_SAPMS38E_010. Hence I do not think that it is possible to create sub menu with this user exit.
    Anyway you can try to modify SAP standard. You need to modify menu for SE38 and then add your code for handling new function codes. You can easily find where you will have to add your code for handling functions from your sub menu. You just need to look for usages of the FM EXIT_SAPMS38E_010.
    Cheers

  • Horizontal sub-menu - can you help?

    I'd like to make a horizontal sub-menu appearing under a
    horiziontal root menu (rather than the usual vertical drop-down
    menu) - can this be done?
    I know I could do this type of menu using Flash but I'd
    rather not contain the navigation for the site in a .swf file - not
    very user-friendly.

    Try:
    - iOS: Not responding or does not turn on
    - Also try DFU mode after try recovery mode
    How to put iPod touch / iPhone into DFU mode « Karthik's scribblings
    - If not successful and you can't fully turn the iOS device fully off, let the battery fully drain. After charging for an least an hour try the above again.
    - If still not successful that usually indicates a hardware problem and an appointment at the Genius Bar of an Apple store is in order.
    Apple Retail Store - Genius Bar       

  • After Effects CS6 locks up when trying to use Preferences sub-menu

    I have an issue with AE "freezing" or locking-up when trying to use any of the sub-menu items under preferences. I have to shut down with task manager to regain control. I have a wintel PC with 8 gig of RAM and 2 TB of disk and a quad-core, don't think any of those are an issue. AE is the only problem child in this entire suite. Any help/guidance is deeply appreciated. Thank you in advance for your time and effort.
    Sincerely,
    Vidmist

    1360 x 768.
    That doesn't meet the system requirements and I think it's safe to say thatr this is the reason for the crash - the program is trying to draw the preferences panel in an invalid area since it cannot deal with the too small screen resolution properly. Increase the screen res and everything will probably work.
    Mylenium

  • How to create a menu with pages linked as sub menu in ADF?

    Hi Experts,
    I'm new to ADF and trying to create a menu like below in ADF.
    Actions Menu
    |
    |
    Option 1 -- A page with some static text and links.
    Option 2 - A different page with some static text and links.
    Have evaluated options like panelGroupLayout and menu components, requesting experts opinion on the best way to do it.
    Thanks in advance..

    Thanks AP.
    Not like outlook. Here's some more details on what I'm looking for.
    Create a menu bar.
    Create a menu called "Actions"
    Create two items under it called "Option1" and "Option2".
    When I move the mouse over "Option1", I want a page to be shown on the right (just like how a sub menu will be displayed usually).
    When I move the mouse over "Option2", I want to show a different page on the right (just like how a sub menu will be displayed usually).
    Thanks in advance.
    Edited by: Muruhanantham C on Dec 28, 2012 12:51 PM

  • Edit Sub Menu Created With Dreamweaver

    Does anyone know how to edit a sub menu that was created
    using Dreamweaver? I need to link a new page to the sub menu but I
    can't seem to find anyway to unlock the menu to amend the link.
    Alternatively, one of my pages appears to be stuck on the server
    saying that it is being edited by Macromedia Contribute after I
    tried to publish it (this is the page I've re-created but can't
    create a link to) so does anyone know how I'd re-set it or
    something? I had thought of uninstalling Contribute then
    re-installing it but I don't know if it'd make much difference?

    Open the template for this page (Select Modify > Templates > Open Attached Template) and add these comments into the <head>...</head> section:
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Eddie and Alice Smith</title>
    <!-- TemplateBeginEditable name="head" -->
    <!-- TemplateEndEditable -->
    <link href="css/main_css.css" rel="stylesheet" type="text/css" />
    <script src="SpryAssets/SpryMenuBar.js" type="text/javascript"></script>
    <link href="SpryAssets/SpryMenuBarHorizontal.css" rel="stylesheet" type="text/css" /></head>
    You have probably deleted these comments when creating the template. These lines allow Dreamweaver to add code into the <head> section. Save your template and say Yes to allow the changes to pages that use this template (or just to the pages you want).
    See http://help.adobe.com/en_US/dreamweaver/cs/using/WScbb6b82af5544594822510a94ae8d65-7acda.h tml for more information.

  • Create new sub-menu item....how???

    Hi,
    I have a site created with Dreamweaver templates.
    I can create a new page from a template but i want to make
    the page a sub-menu page.
    For instance i have an 'about us' page and from this 'about
    us' page i want to create a sub page. None os these areas have been
    locked but i can't find a way to do it.
    Is it possible?
    am i missing something?
    Any tutorials anywhere?
    Thanks for any help
    J

    You'll probably want to make any menu changes (since the menu
    may be an element that is present on all your pages...hence the use
    of a template) in the non-editable regions in Dreamweaver, then
    uploade the template and do a template update in Contribute
    (Edit-->Format-->Template
    Properties-->Apply-->OK-->Publish).
    As a rule, your menu/navigation should be laid out in the
    template prior to using the template to create new pages (not
    exactly sure what you mean by "sub pages"). In other words, your
    template navigation/menu determines the main navigation you want
    available on EVERY page you create with the template. If you then
    create a new page in Contribute using the template, you're free to
    create links (in the editable regions) to any page you want
    (existing or new), including pages that are already linked-to in
    the menu.
    Hope this helps!

  • How to create a Sub Menu?

    I know it can be done. But just can't find how to do a
    submenu that shows when you roll the mouse on main menu, and hides
    if your mouse is anywhere else. I can imagine that I can create the
    sub-menu with a movie clip symbol containing each command or choice
    as a button. But waht I don't know it how to keep it hidden and to
    make it only shown when you point the main menu that should
    activate ths sub menu.
    Thanks for your help

    You can use click events on the main menu to trigger the
    submenus and then use rollOver events to know which submenu to show
    and which to make invisible.

  • Creating a sub menu

    Hey.  I didnt get a reply before, so I thought I would try a fresh post so I can explain things better.
    Basically, I have a navigation bar with several buttons.  When a button is pressed, a new sub navigation should be displayed in a different location.  So on my main nav, I have mouse events, and on the click event, each button points to an xml file
    function mouseClickEvent3(eve:MouseEvent):void
        setLoader("XML/path.xml");
    the setLoader method is
    function setLoader(xmlPath:String):void{
        loader.addEventListener(Event.COMPLETE, xmlLoaded);
        loader.load(new URLRequest(xmlPath));
    And on complete, it calls up xmlLoaded which holds
    if ((e.target as URLLoader) != null )
            settingsXML = new XML(loader.data);
            settingsXML.ignoreWhitespace = true;
            createMenu();
    The createMenu method is where the menus are created.
    function createMenu():void
        var menuItem:MenuItem;
        var i:uint = 0;
        for each (var link:XML in settingsXML.links.link)
            menuItem = new MenuItem();
            menuItem.menuLabel.text = link. @ name;
            addChild(menuItem);
            i++;
    Now all the menus get created no problem.  The problem is this.  One main button produces a sub menu with six buttons, which are displayed no problem.  I then click on another main button which has 3 sub buttons.  These 3 buttons replace the 3 buttons that the first button displayed, but the last three are not removed.  Sometimes, only two buttons seem to get replaced.
    What I really need to do is this.  Before any buttons are created, I need to somehow remove any buttons which currently exist.  I have tried things like this before the for each loop
    for (var y:Number=0; y<i; y++){
       removeChild(menuItem);
    Nothing seems to work though.  So any suggestions on how I can overcome this issue would be great.
    cheers

    Kool.  trying to follow your suggestion.  So I have created an Array outside of the function so it doesnt get recreated each time.  Then before I do
    addChild(menuItem); 
    I have
    ary.push(menuItem);
    The problem is that I cant see how this Array can help to remove items.  Before the for each loop, I have tried something like this without success
    for(var j:Number=0; j<ary.length; j++){
            removeChild(menuItem);
    If I do a trace on the arrays length outside the for each loop however, it is always 0 which will be the reason the child isnt removed. At the moment, I have it like this
    var ary:Array = new Array();
    function createMenu():void
        var menuItem:MenuItem;
        var i:uint = 0;
        trace(ary.length); //shows 0 every time
        for(var j:Number=0; j<ary.length; j++){
            removeChild(menuItem);
        for each (var link:XML in settingsXML.links.link)
            menuItem = new MenuItem();
            menuItem.menuLabel.text = link. @ name;
            ary.push(menuItem);
            trace(ary.length); //shows correct length
            addChild(menuItem);
            i++;
    My original thinking was that in English, for each menuItem that is on the stage to be removed, before new ones are created.  Its like I need a reset function which will completely remove any children which are displayed.  The problem is, If I create a for each loop, I am not sure what my arguement would be.
    Any further advise always appreciated.
    Cheers

  • How Can I Create A Menu contained some sub-menu In The Find/Browser Form

    I need to create an user defined menu in the Find/Browser Form, this menu`s level is same to "File","Row" and it needs to be contained some sub-menu,What I should do?

    Are you using JD Edwards World or EnterpriseOne?

  • Positioning of spry sub menu in IE8

    Hi - can anyone help with an IE8 issue concerning Spry? I have created a menu here:
    http://www.clinicafiore.co.uk/jan2012/indexJan2012_1.html
    In all the browsers I have tested (Chrome,FF,Safari,Opera) on Mac and PC platforms it works fine. In IE8 it doesn't (hooray).
    The critical attribute is:
    ul.MenuBarHorizontal ul.MenuBarSubmenuVisible
      left: 189px;
      top: 0;
    I.e. I have pushed the sub-menu out 189px when visible and set the top value to 0 thinking this would align the sub-menu with the top of the main menu item.
    Is there a better way to do this to cover all browsers or do I need some conditional code for IE?
    Really.really grateful for any help
    For good measure here's all the  html & the css
    HTML
    <div id="leftNav">
        <ul id="MenuBar1" class="MenuBarHorizontal">
          <li><a href="#" title="ageing body" class="MenuBarItemSubmenu">AGEING BODY</a>
            <ul>
              <li><a href="#">Ageing D&eacute;collet&eacute;</a></li>
              <li><a href="#">Ageing Hands</a></li>
              <li><a href="#">Ageing Neck</a></li>
            </ul>
          </li>
          <li><a href="#" class="MenuBarItemSubmenu">ageing face</a>
            <ul>
              <li><a href="#">Ageing Lips</a></li>
              <li><a href="#">Double Chin</a></li>
              <li><a href="#">Downturned Mouth</a></li>
            </ul>
          </li>
          <li><a class="MenuBarItemSubmenu" href="#">Item 3</a>
            <ul>
              <li><a class="MenuBarItemSubmenu" href="#">Item 3.1</a>
                <ul>
                  <li><a href="#">Item 3.1.1</a></li>
                  <li><a href="#">Item 3.1.2</a></li>
                </ul>
              </li>
              <li><a href="#">Item 3.2</a></li>
              <li><a href="#">Item 3.3</a></li>
            </ul>
          </li>
          <li><a href="#">Item 4</a></li>
        </ul>
      </div>
    CSS
    ul.MenuBarHorizontal
              margin: 0;
              padding: 0;
              list-style-type: none;
              font-size: 0.9em;
              cursor: default;
              width: auto;
    /* Set the active Menu Bar with this class, currently setting z-index to accomodate IE rendering bug: http://therealcrisp.xs4all.nl/meuk/IE-zindexbug.html */
    ul.MenuBarActive
              z-index: 1000;
    /* Menu item containers, position children relative to this container and are a fixed width */
    ul.MenuBarHorizontal li
              margin: 0;
              padding: 0;
              list-style-type: none;
              font-size: 0.9em;
              position: relative;
              text-align: left;
              cursor: pointer;
              width: 189px;
              float: left;
              font-weight: bold;
              text-transform: uppercase;
    /* Submenus should appear below their parent (top: 0) with a higher z-index, but they are initially off the left side of the screen (-1000em) */
    ul.MenuBarHorizontal ul
              margin: 0;
              padding: 0;
              list-style-type: none;
              font-size: 100%;
              z-index: 1020;
              cursor: default;
              width: 189px;
              position: absolute;
              left: -1000em;
    /* Submenu that is showing with class designation MenuBarSubmenuVisible, we set left to auto so it comes onto the screen below its parent menu item */
    ul.MenuBarHorizontal ul.MenuBarSubmenuVisible
              left: 189px;
              top: 0;
    /* Menu item containers are same fixed width as parent */
    ul.MenuBarHorizontal ul li
              width: 189px;
              font-weight: normal;
              text-transform: none;
    /* Submenus should appear slightly overlapping to the right (95%) and up (-5%) */
    ul.MenuBarHorizontal ul ul
              position: absolute;
              margin: -5% 0 0 95%;
    /* Submenu that is showing with class designation MenuBarSubmenuVisible, we set left to 0 so it comes onto the screen */
    ul.MenuBarHorizontal ul.MenuBarSubmenuVisible ul.MenuBarSubmenuVisible
              left: auto;
              top: 0;
    DESIGN INFORMATION: describes color scheme, borders, fonts
    /* Submenu containers have borders on all sides */
    ul.MenuBarHorizontal ul
              border: 1px solid #CCC;
              font-weight: normal;
              text-transform: none;
    /* Menu items are a light gray block with padding and no text decoration */
    ul.MenuBarHorizontal a
              display: block;
              cursor: pointer;
              background-color: #aee56b;
              padding: 0.5em 0.75em;
              color: #333;
              text-decoration: none;
              border-bottom-width: thin;
              border-bottom-style: dotted;
              border-bottom-color: #FFF;
    /* Menu items that have mouse over or focus have a blue background and white text */
    ul.MenuBarHorizontal a:hover, ul.MenuBarHorizontal a:focus
              background-color: #999999;
              color: #FFF;
    /* Menu items that are open with submenus are set to MenuBarItemHover with a blue background and white text */
    ul.MenuBarHorizontal a.MenuBarItemHover, ul.MenuBarHorizontal a.MenuBarItemSubmenuHover, ul.MenuBarHorizontal a.MenuBarSubmenuVisible
              background-color: #999999;
              color: #FFF;
    SUBMENU INDICATION: styles if there is a submenu under a given menu item
    /* Menu items that have a submenu have the class designation MenuBarItemSubmenu and are set to use a background image positioned on the far left (95%) and centered vertically (50%) */
    ul.MenuBarHorizontal a.MenuBarItemSubmenu
              background-image: url(SpryMenuBarRight.gif);
              background-repeat: no-repeat;
              background-position: 95% 50%;
    /* Menu items that have a submenu have the class designation MenuBarItemSubmenu and are set to use a background image positioned on the far left (95%) and centered vertically (50%) */
    ul.MenuBarHorizontal ul a.MenuBarItemSubmenu
              background-image: url(SpryMenuBarRight.gif);
              background-repeat: no-repeat;
              background-position: 95% 50%;
    /* Menu items that are open with submenus have the class designation MenuBarItemSubmenuHover and are set to use a "hover" background image positioned on the far left (95%) and centered vertically (50%) */
    ul.MenuBarHorizontal a.MenuBarItemSubmenuHover
              background-image: url(SpryMenuBarRight.gif);
              background-repeat: no-repeat;
              background-position: 95% 50%;
    /* Menu items that are open with submenus have the class designation MenuBarItemSubmenuHover and are set to use a "hover" background image positioned on the far left (95%) and centered vertically (50%) */
    ul.MenuBarHorizontal ul a.MenuBarItemSubmenuHover
              background-image: url(SpryMenuBarRightHover.gif);
              background-repeat: no-repeat;
              background-position: 95% 50%;
    BROWSER HACKS: the hacks below should not be changed unless you are an expert
    /* HACK FOR IE: to make sure the sub menus show above form controls, we underlay each submenu with an iframe */
    ul.MenuBarHorizontal iframe
              position: absolute;
              z-index: 1010;
              filter:alpha(opacity:0.1);
    /* HACK FOR IE: to stabilize appearance of menu items; the slash in float is to keep IE 5.0 from parsing */
    @media screen, projection
              ul.MenuBarHorizontal li.MenuBarItemIE
                        display: inline;
                        f\loat: left;
                        background: #FFF;

    I may be misinterpreting what it is that you want, partly because I thought we were talking horizontal menu and you point out a vertical menu.
    I think that you used the vertical menu as an illustration to shopw how you want the submenu alligned. If that is correct, then please copy an paste the following into a new document and see the result in an IE8 browser.
    <!DOCTYPE HTML>
    <html>
    <head>
    <meta charset="utf-8">
    <title>Untitled Document</title>
    <link href="http://labs.adobe.com/technologies/spry/widgets/menubar/SpryMenuBarHorizontal.css" rel="stylesheet">
    <style>
    ul.MenuBarHorizontal ul {margin-left: 8em; margin-top: -35px;}
    </style>
    </head>
    <body>
    <ul id="MenuBar1" class="MenuBarHorizontal">
      <li><a class="MenuBarItemSubmenu" href="#">Item 1</a>
        <ul>
          <li><a href="#">Item 1.1</a></li>
          <li><a href="#">Item 1.2</a></li>
          <li><a href="#">Item 1.3</a></li>
        </ul>
      </li>
      <li><a href="#">Item 2</a></li>
      <li><a class="MenuBarItemSubmenu" href="#">Item 3</a>
        <ul>
          <li><a class="MenuBarItemSubmenu" href="#">Item 3.1</a>
            <ul>
              <li><a href="#">Item 3.1.1</a></li>
              <li><a href="#">Item 3.1.2</a></li>
            </ul>
          </li>
          <li><a href="#">Item 3.2</a></li>
          <li><a href="#">Item 3.3</a></li>
        </ul>
      </li>
      <li><a href="#">Item 4</a></li>
    </ul>
    <script src="http://labs.adobe.com/technologies/spry/includes_minified/SpryMenuBar.js"></script>
    <script>
    var MenuBar1 = new Spry.Widget.MenuBar("MenuBar1", {imgDown:"SpryAssets/SpryMenuBarDownHover.gif", imgRight:"SpryAssets/SpryMenuBarRightHover.gif"});
    </script>
    </body>
    </html>
    If the above is not what you want, then please explain.
    Gramps

  • Creating sub-pages in iWeb'09?

    Hello!
    i've just starte using iWeb, and trying to create my own web page. I can't find a solution on the above: how can i create "sub-pages"? For example: I want to create a main page called Photos (appearing in main menu bar), and UNDER this page i want to create "sub-pages" called photos1, photos2, photos3, etc. (appearing UNDER Photos page).
    How can I do this?
    Thanks,
    Bazsi21

    Hello:
    I just read your post regarding creating web pages in iweb. This is something i have been trying to do also. Do you happen to know whether there's a way of creating sub pages from the main navigation menu, rather than pasting hyperlinks into the page. If i create an envertainment magazine, and one section is "movies", then I want all articles on movies to fall within that category, WOuld be far easier if visitors click on 'movies' link in navigation bar, and then see the list of articles. Is there a way to do this in iweb?
    If not, i am wondering why Apple didn't include this basic necessity when creating the program.
    I look forward to hearing from you.
    Thanks.

Maybe you are looking for