Adding menu items

I am writing a program using netbeans. I have put in a menu bar and a menu from the palette. I don't know how to add menu items. The explanation in the tutorial says how to code it in at the place where the GUI is constructed. But this is in a blue area in the source listing and it won't let me edit it. Help.

I am writing a program using netbeans. I have put in
a menu bar and a menu from the palette. I don't know
how to add menu items. The explanation in the
tutorial says how to code it in at the place where
the GUI is constructed. But this is in a blue area in
the source listing and it won't let me edit it.
Help.just look at the properties maybe you miss something or you can add
menu items manually.

Similar Messages

  • Help Adding Menu Items to Bridge

    I've created (modified) a couple of Bridge Scripts and finally have them working nicely. Now, I want to add a couple of Menu Commands to execute them. I tried modifying a script in the SDK, SnpAddMenuItem.jsx, which would work fine if I only had one Menu Item/Command. Here is what I have. I obviously don't understand the 'this' object or how to separate the Commands. Help much appreciated.
    function SnpAddMenuItem()
              this.requiredContext = "\tAdobe Bridge must be running.\n\tExecute against Bridge CS5 as the target.\n";
              this.menuID = "snpAddMenuItem";
              this.menuCommandID = "snpAddMenuItemSub";
              $.level = 1; // Debugging level
    SnpAddMenuItem.prototype.run = function()
              var retval = true;
              if(!this.canRun()) {
                        retval = false;
                        return retval;
        var newMenu = new MenuElement( "menu", "Scanning", "after Window", this.menuID );
        var stackCommand = new MenuElement( "command", "Gather NNYY Into Stacks", "at the end of " + this.menuID, this.menuCommandID );
        var maskCommand = new MenuElement( "command", "Process Stacks into Layers", "at the end of " + this.menuID, this.menuCommandID );
              stackCommand.onSelect = function()
                        var scriptFilePath = "~/Documents/Adobe Scripts/AutostackNNYY.jsx";
             var scriptFile = new File (scriptFilePath);
             $.evalFile( scriptFile );
        return retval;
              maskCommand.onSelect = function()
                        var scriptFilePath = "~/Documents/Adobe Scripts/StacksToLayers.jsx";
             var scriptFile = new File (scriptFilePath);
             $.evalFile( scriptFile );
              return retval;
      Determines whether snippet can be run given current context.  The snippet
      fails if these preconditions are not met:
      <ul>
      <li> Must be running in Bridge
      <li> Must only be executed once in a session
      </ul>
      @return True if this snippet can run, false otherwise
      @type boolean
    SnpAddMenuItem.prototype.canRun = function()
              // Must run in Bridge
              if(BridgeTalk.appName == "bridge") {
                        // Stop the menu element from being added again if the snippet has already run
                        if((MenuElement.find(this.menuID)) && (MenuElement.find(this.menuCommandID)))
                                  $.writeln("Error:Menu element already exists!\nRestart Bridge to run this snippet again.");
                                  return false;
                        return true;
              // Fail if these preconditions are not met. 
              // Bridge must be running,
              // The menu must not already exist.
              $.writeln("ERROR:: Cannot run SnpAddMenuItem");
              $.writeln(this.requiredContext);
              return false;
      "main program": construct an anonymous instance and run it,
      as long as we are not unit-testing this snippet.
    if(typeof(SnpAddMenuItem_unitTest ) == "undefined") {
              new SnpAddMenuItem().run();

    This will put the two commands at the bottom of the Tools menu....
    #target bridge  
       if( BridgeTalk.appName == "bridge" ) { 
    var stackCommand = new MenuElement( "command", "Gather NNYY Into Stacks", "at the end of Tools","uniqueId1");
    var maskCommand = new MenuElement( "command", "Process Stacks into Layers","at the end of Tools","uniqueId2");
    stackCommand.onSelect = function () {
    //Your code goes here
    maskCommand.onSelect = function () {
    //Your code goes here

  • Adding menu items and making system calls in AfterEffects (AE,CS3)

    We are looking to do the following things via javascript in AfterEffects CS3. It does seem straight-forward, but am unable to find a good reference or example.
    * Add at startup a menu item under "File" (or similar main menu) and have it call a script function when clicked.
    * Have a script make an external system call (to launch an external application/executable with a few parameters)
    Any insights on how to achieve this?
    Many thanks!

    I wanted to see if there was any update on this, I'm writing a series of tools and would love to create a custom menu for quick and easy access.
    If it turns out there isn't an "easy" way to do this (env variables, special directory locations, javascripts) would anyone know if access to the menubar is possible from the Plugin API?
    I'm fairly new to After Effects, just getting up-to-speed on the environment now... seeing if I can duplicate the functionality of some old Nuke scripts in AE.
    thanks,
    Rick_

  • Adding Menu Items that are not pages.

    I want to add menu items that are not pages that I will create in Muse. They are linking to Wordpress pages that I have. How do I do this with a menu widget?

    Just look here:
    How can I create a hyperlink to a thirth party WEB site from Muse?

  • Problem when trying to add a link to the left menu item!!!!

    Hi everyone,
    I am trying to put a new menu group on the left menu,with a link in that group for every one.On checking with the customization guide this is what i did
    for one link i did add the following lines in each of the files
    1)xlWebAdmin.properties
    - menuGroup.Misc-Menu=Misc Menu
    - menuItem.Misc-Menu.My-Nomination=My Nomination
    2) xlDefaultAdmin.properties
    - menuItem.Misc-Menu.My-Nomination.link=mynomineefrm?showfrm
    3) repacked the war and the ear
    4) Restarted my server
    When I login into the administration(xelsysadm) page I didnt see any menu item with name "My Nomination" which i am supposed to see.
    secondly it shows the menu item when ever i select some group and click on assign menu item.
    Moreover, when I try to assign this menu item to all users group it gives me this error
    On browser it prints
    Permission Denied to Assign Selected Menu Items
    You do not have the permissions to assign one or more selected menu items.
    on console it prints
    ERROR [SERVER] Class/Method: tcDataObj/eventPreInsert Error :Insert
    permission is denied
    ERROR [APIS] Class/Method: tcGroupOperationsBean/addMenuItems encou
    nter some problems: maoRejections:You do not have permission to insert this obje
    ct.
    ERROR [APIS] Class/Method: tcGroupOperationsBean/addMenuItems encou
    nter some problems: Error occurred while adding menu items.
    ERROR [WEBAPP] Class/Method: UserGroupMenuItemsAction/commitGroupAs
    signMenuItems encounter some problems: {1}
    Thor.API.Exceptions.tcBulkException
    This problem eat my happy sunday :-(, any one has solution for this problem?
    - Also if some one can help on how to link jsp to the new link will be helpful for me!
    Thanks,
    doki

    Design Console > Form Information > add new
    Class Name Organizations.Merge
    Description Move users from one organization to another
    Type menuitem
    Add following to xlWebAdmin.properties, xlWebAdmin_en_US.properties
    Organizations.Merge=mergeOrgs.do?Display
    menuItem.Organizations.Merge.link=mergeOrgs.do?MergeOrganizations
    menuItem.Organizations.Merge=Merge
    mergeOrgs.button.display=Merge Organizations
    Even you have to assign first to System Administrator group
    First go to Manage Group
    Select System Administrator Group
    Select Menu Item
    Click Assign and select newly craeted Menu Item and click Confirm
    These are the steps to see the new menu item. To make this menu item working:
    you'll have to write action class, form bean class and you'll have to create JSPs and make their entry in struts-config as welll as in Tiles-def.xml
    Then your menu item will work.

  • Add menu item for Batch Sequence?

    Hello,
    I've created a folder level script that will execute when Acrobat starts. The script adds a menu item, that when clicked, will call another function.
    I'm wondering if I can create a batch sequence and add a menu item for that as well? I basically just want to avoid going through the whole Advanced -> Doucment Processing -> Batch processing... -> and then find the batch sequence and click Run.
    I've seen plenty of examples for adding menu items that call folder level scripts, but nothing on batch sequences. Has anyone ever done this?
    Many thanks in advance!

    You can't create a menu item to a specific batch sequence. The closest you
    can get is to open the batch sequences window, using the execMenuItem()
    method and "BatchEdit" as the name of the command (I'm not sure it's still
    the same in Acrobat X).

  • My user defined menu items not shown up in Main Menu

    Hi,
    I have some my own menu items need to add into Main Menu list, it works fine but only issue is the screen flash lot. Since all the menu items are in the form called "Main Menu" form then I tried to use oForm.Freeze(true) and oForm.Freeze(false) before and after adding menu items. Now the weird thing is though the screen doesn't flash but i can't see the new added menu items in the Main Menu form. But I can see them under the system menu Modules menu. Any idea?
    Thanks!
    Lan

    Hi All,
    After check the SDK help, I found the reason. I need to call oForm.Update() after. Now it works well.
    Lan

  • Adding ZoomIn functionality to the Gantt menu Items

    Hi
    We have a requirement of adding ZoomIn/ZoomOut as MenuItem in Gantt.
    As ZoomIn/ ZoomOut is an implicit functionality of Gantt.Is there any way to do this?

    You can add a custom menu with zoom-in/zoom-out menu-items to Gantt's menubar. In the action listener of the new menu-item, you can update the scale attribute of the major/minor dvt:timeAxis to the new zoom level, and ppr gantt.
    This approach will not work in the older versions, but should work in the latest production release out on the OTN.

  • Adding icons to menu items

    Okay, I'm a newbie at Java. I have a problem that I'm trying to solve. I added icons to the File menu item, that was easy, but how do I add icons to the other menu items? They are DefaultEditorKit. actions (cut copy paste undo redo) I can't seem to change their names either.
    I'm also having problems with saving the changes I make in the text area.
    Here's the whole code.
    package components;
    import java.awt.*;
    import java.awt.event.*;
    import java.util.HashMap;
    import java.io.*;
    import javax.swing.*;
    import javax.swing.AbstractButton;
    import javax.swing.text.*;
    import javax.swing.event.*;
    import javax.swing.undo.*;
    public class TextComponentDemo extends JFrame implements ActionListener {
        JTextPane textPane;
        AbstractDocument doc;
        JTextArea changeLog;
        JButton newButton, openButton, saveButton, undoButton, redoButton, /*cutButton, copyButton, pasteButton,*/ boldButton, italicButton, underlineButton;
        protected String newline = "\n";
        HashMap<Object, Action> actions;
         File fFile = new File("default.txt");
         JavaFilter fJavaFilter = new JavaFilter();
        protected UndoAction undoAction;
        protected RedoAction redoAction;
        protected UndoManager undo = new UndoManager();
        public TextComponentDemo() {
            super("Notepad v1.0");
            //Create the text pane and configure it.
            textPane = new JTextPane();
            textPane.setCaretPosition(0);
            textPane.setMargin(new Insets(5,5,5,5));
            StyledDocument styledDoc = textPane.getStyledDocument();
            if (styledDoc instanceof AbstractDocument) {
                doc = (AbstractDocument)styledDoc;
            } else {
                System.err.println("Text pane's document isn't an AbstractDocument!");
                System.exit(-1);
            JScrollPane scrollPane = new JScrollPane(textPane);
            scrollPane.setPreferredSize(new Dimension(600, 350));
            newButton = new JButton ("", createImageIcon("images/new.png"));
            newButton.setBackground(Color.white);
       //     newButton.setActionCommand("nou");       
       //     newButton.addActionListener(this);        
            openButton = new JButton("", createImageIcon("images/open.png"));
            openButton.setBackground(Color.white);
            openButton.setActionCommand("deschide");       
            openButton.addActionListener(this);
            saveButton = new JButton("", createImageIcon("images/save.png"));
            saveButton.setBackground(Color.white);
            saveButton.setActionCommand("salveaza");       
            saveButton.addActionListener(this);
            Action actionBold = new StyledEditorKit.BoldAction();
            actionBold.putValue(Action.NAME, "Bold");
            boldButton = new JButton(actionBold);
            boldButton.setBackground(Color.white);
            Action actionItalic = new StyledEditorKit.ItalicAction();
            actionItalic.putValue(Action.NAME, "Italic");
            italicButton = new JButton(actionItalic);
            italicButton.setBackground(Color.white);
            Action actionUnderline = new StyledEditorKit.UnderlineAction();
            actionUnderline.putValue(Action.NAME, "Underline");
            underlineButton = new JButton(actionUnderline);
            underlineButton.setBackground(Color.white);
              String[] fontStrings = { "Arial", "Arial Black", "Comic Sans MS", "Georgia", "Serif", "SansSerif", "Times New Roman", "Trebuchet MS", "Verdana" };
              JComboBox fontList = new JComboBox(fontStrings);
            fontList.setSelectedIndex(0);
            fontList.setBackground(Color.white);
            fontList.setActionCommand("font");
            fontList.addActionListener(this);
               String[] sizeStrings = { "12", "14", "16", "18", "20", "22", "24", "36", "48" };
              JComboBox sizeList = new JComboBox(sizeStrings);
            sizeList.setSelectedIndex(0);
            sizeList.setBackground(Color.white);
            sizeList.setActionCommand("size");
            sizeList.addActionListener(this);
            JPanel buttonPanel = new JPanel(); //use FlowLayout
              buttonPanel.add(newButton);
            buttonPanel.add(openButton);
            buttonPanel.add(saveButton);
         //   buttonPanel.add(cutButton);
         //   buttonPanel.add(copyButton);
         //   buttonPanel.add(pasteButton);
            buttonPanel.add(boldButton);
            buttonPanel.add(italicButton);
            buttonPanel.add(underlineButton);
            buttonPanel.add(fontList);
            buttonPanel.add(sizeList);
            getContentPane().add(buttonPanel, BorderLayout.PAGE_START);
             getContentPane().add(scrollPane, BorderLayout.CENTER);
            //Set up the menu bar.
            createActionTable(textPane);
            JMenu fileMenu = createFileMenu();
            JMenu editMenu = createEditMenu();
            JMenu fontMenu = createFontMenu();
            JMenu ajutorMenu = createAjutorMenu();
            JMenuBar mb = new JMenuBar();
            mb.add(fileMenu);
            mb.add(editMenu);
            mb.add(fontMenu);
            mb.add(ajutorMenu);
            setJMenuBar(mb);
            //Start watching for undoable edits and caret changes.
            doc.addUndoableEditListener(new MyUndoableEditListener());
           //This one listens for edits that can be undone.
        protected class MyUndoableEditListener
                        implements UndoableEditListener {
            public void undoableEditHappened(UndoableEditEvent e) {
                //Remember the edit and update the menus.
                undo.addEdit(e.getEdit());
                undoAction.updateUndoState();
                redoAction.updateRedoState();
    private ImageIcon createImageIcon (String fileName) {
          return new ImageIcon(fileName);
    protected JMenu createFileMenu() {
              JMenu menu = new JMenu("Fisier");
              menu.setMnemonic(KeyEvent.VK_F);
            JMenuItem menuItem;
            ImageIcon iconNou = new ImageIcon("images/new.png");
            menuItem = new JMenuItem("Nou", iconNou);
            menuItem.setMnemonic(KeyEvent.VK_N);
            menuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_N, ActionEvent.CTRL_MASK));
       //   menuItem.setActionCommand("nou");       
       //   menuItem.addActionListener(this);         
            menu.add(menuItem);
         menu.addSeparator();
              ImageIcon iconOpen = new ImageIcon("images/open.png");
              menuItem = new JMenuItem("Deschide", iconOpen);
            menuItem.setMnemonic(KeyEvent.VK_O);
            menuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_O, ActionEvent.CTRL_MASK));
              menuItem.setActionCommand("deschide");       
            menuItem.addActionListener(this);
              menu.add(menuItem);
              ImageIcon iconSave = new ImageIcon("images/save.png");
              menuItem = new JMenuItem("Salveaza", iconSave);
            menuItem.setMnemonic(KeyEvent.VK_S);
            menuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_S, ActionEvent.CTRL_MASK));
              menuItem.setActionCommand("deschide");       
            menuItem.addActionListener(this);
              menu.add(menuItem);          
         menu.addSeparator();     
              ImageIcon iconQuit = new ImageIcon("images/quit.png");
              menuItem = new JMenuItem("Iesire", iconQuit);
            menuItem.setMnemonic(KeyEvent.VK_Q);
            menuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_Q, ActionEvent.CTRL_MASK));
              menuItem.setActionCommand("iesire");       
            menuItem.addActionListener(this);
              menu.add(menuItem);                    
              return menu;
         public void actionPerformed(ActionEvent e) {
             boolean status = false;
           /* if ("nou".equals(e.getActionCommand())) {
                 nou();
            if ("deschide".equals(e.getActionCommand())) {
                 status = openFile();
                   if(!status)
                        JOptionPane.showMessageDialog(
                             null,
                             "Eroare la deschiderea fisierului!", "Fisierul nu a putut fi deschis.",
                             JOptionPane.ERROR_MESSAGE
          /* if ("salveaza".equals(e.getActionCommand())) {
                 status = saveFile();
                   if(!status)
                        JOptionPane.showMessageDialog(
                             null,
                             "Eroare IO in salvarea fisierului!", "Fisierul nu a putut fi salvat.",
                             JOptionPane.ERROR_MESSAGE
            if ("iesire".equals(e.getActionCommand())) {
                 System.exit(-1);
            if ("font".equals(e.getActionCommand())) {
                 JComboBox cb = (JComboBox)e.getSource();
                 String fontName = (String)cb.getSelectedItem();
                 String t = new String(textPane.getSelectedText());
    //               t.setText("fontName");
    //             t.setFont(new java.awt.Font(fontName, 0, 12));
    //               StyledEditorKit.FontFamilyAction font = new StyledEditorKit.FontFamilyAction(fontName, fontName);
         boolean openFile() {
                JFileChooser fc = new JFileChooser();
                fc.setDialogTitle("Deschide Fisier");
                fc.setFileSelectionMode(JFileChooser.FILES_ONLY);
                fc.setCurrentDirectory(new File ("."));
                fc.setFileFilter(fJavaFilter);
                int result = fc.showOpenDialog(this);
                if(result == JFileChooser.CANCEL_OPTION) {
                     return true;
                else if(result == JFileChooser.APPROVE_OPTION) {
                     fFile = fc.getSelectedFile();
                     String file_string = readFile(fFile);
                     if(file_string != null) {
                          textPane.setText(file_string);
                     else
                          return false;
                else {
                     return false;
                return true;                                         
            public String readFile (File file) {
              StringBuffer fileBuffer;
             String fileString=null;
             String line;   
             try {
                   FileReader in = new FileReader (file);
                    BufferedReader dis = new BufferedReader (in);
                    fileBuffer = new StringBuffer () ;
                   while ((line = dis.readLine ()) != null) {
                     fileBuffer.append (line + "\n");
                    in.close ();
                    fileString = fileBuffer.toString ();
                  catch  (IOException e ) {
                    return null;
             return fileString;
    /* boolean saveFile () {
         File file = null;
         JFileChooser fc = new JFileChooser ();
         fc.setCurrentDirectory (new File ("."));
         fc.setFileFilter (fJavaFilter);
         fc.setSelectedFile (fFile);
         int result = fc.showSaveDialog (this);
         if (result == JFileChooser.CANCEL_OPTION) {
             return true;
         } else if (result == JFileChooser.APPROVE_OPTION) {
             fFile = fc.getSelectedFile ();
             if (fFile.exists ()) {
                 int response = JOptionPane.showConfirmDialog (null,
                   "Overwrite existing file?","Confirm Overwrite",
                    JOptionPane.OK_CANCEL_OPTION,
                    JOptionPane.QUESTION_MESSAGE);
                 if (response == JOptionPane.CANCEL_OPTION) return false;
             return writeFile (fFile, textPane.getText ());
         } else {
           return false;
      protected JMenu createEditMenu() {
            JMenu menu = new JMenu("Editare");
            menu.setMnemonic(KeyEvent.VK_E);
            JMenuItem menuItem;
            undoAction=new UndoAction();
            menu.add(undoAction);   
            redoAction = new RedoAction();
            menu.add(redoAction);
            menu.addSeparator();
              menu.add(getActionByName(DefaultEditorKit.cutAction));       
            menu.add(getActionByName(DefaultEditorKit.copyAction));
            menu.add(getActionByName(DefaultEditorKit.pasteAction));
            menu.addSeparator();
            menu.add(getActionByName(DefaultEditorKit.selectAllAction));
            return menu;
        //Create the style menu.
        protected JMenu createFontMenu() {
            JMenu menu = new JMenu("Font");
            menu.setMnemonic(KeyEvent.VK_F);
            JMenu subMenu = new JMenu ("Stil ");
            Action action = new StyledEditorKit.BoldAction();
            action.putValue(Action.NAME, "Bold");
            subMenu.add(action);
            action = new StyledEditorKit.ItalicAction();
            action.putValue(Action.NAME, "Italic");
            subMenu.add(action);
            action = new StyledEditorKit.UnderlineAction();
            action.putValue(Action.NAME, "Underline");
            subMenu.add(action);
              menu.add(subMenu);
            menu.addSeparator();
            JMenu subMenu2 = new JMenu ("Marime ");
            subMenu2.add(new StyledEditorKit.FontSizeAction("12", 12));
            subMenu2.add(new StyledEditorKit.FontSizeAction("14", 14));
            subMenu2.add(new StyledEditorKit.FontSizeAction("16", 16));
            subMenu2.add(new StyledEditorKit.FontSizeAction("18", 18));
            subMenu2.add(new StyledEditorKit.FontSizeAction("20", 20));
            subMenu2.add(new StyledEditorKit.FontSizeAction("22", 22));
            subMenu2.add(new StyledEditorKit.FontSizeAction("24", 24));
            subMenu2.add(new StyledEditorKit.FontSizeAction("36", 36));
            subMenu2.add(new StyledEditorKit.FontSizeAction("48", 48));
            menu.add(subMenu2);
            menu.addSeparator();
            JMenu subMenu3 = new JMenu ("Familie ");
            subMenu3.add(new StyledEditorKit.FontFamilyAction("Arial", "Arial"));
            subMenu3.add(new StyledEditorKit.FontFamilyAction("Arial Black", "Arial Black"));
            subMenu3.add(new StyledEditorKit.FontFamilyAction("Comic Sans MS", "Comic Sans MS"));
            subMenu3.add(new StyledEditorKit.FontFamilyAction("Georgia", "Georgia"));
            subMenu3.add(new StyledEditorKit.FontFamilyAction("Serif", "Serif"));
            subMenu3.add(new StyledEditorKit.FontFamilyAction("SansSerif", "SansSerif"));
            subMenu3.add(new StyledEditorKit.FontFamilyAction("Times New Roman", "Times New Roman"));
            subMenu3.add(new StyledEditorKit.FontFamilyAction("Trebuchet MS", "Trebuchet MS"));
            subMenu3.add(new StyledEditorKit.FontFamilyAction("Verdana", "Verdana"));
            menu.add(subMenu3);
            menu.addSeparator();
            JMenu subMenu4 = new JMenu ("Culoare ");
            subMenu4.add(new StyledEditorKit.ForegroundAction("Rosu", Color.red));
            subMenu4.add(new StyledEditorKit.ForegroundAction("Verde", Color.green));
            subMenu4.add(new StyledEditorKit.ForegroundAction("Albastru", Color.blue));
            subMenu4.add(new StyledEditorKit.ForegroundAction("Galben", Color.yellow));
            subMenu4.add(new StyledEditorKit.ForegroundAction("Gri", Color.gray));
            subMenu4.add(new StyledEditorKit.ForegroundAction("Gri inchis", Color.darkGray));
            subMenu4.add(new StyledEditorKit.ForegroundAction("Negru", Color.black));
            menu.add(subMenu4);
            return menu;
        protected JMenu createAjutorMenu() {
             JMenu menu = new JMenu("Ajutor");
            menu.setMnemonic(KeyEvent.VK_J);
            return menu;
        private void createActionTable(JTextComponent textComponent) {
            actions = new HashMap<Object, Action>();
            Action[] actionsArray = textComponent.getActions();
            for (int i = 0; i < actionsArray.length; i++) {
                Action a = actionsArray;
    actions.put(a.getValue(Action.NAME), a);
    private Action getActionByName(String name) {
    return actions.get(name);
    class UndoAction extends AbstractAction {
    public UndoAction() {
    super("Undo");
    setEnabled(false);
    public void actionPerformed(ActionEvent e) {
    try {
    undo.undo();
    } catch (CannotUndoException ex) {
    System.out.println("Unable to undo: " + ex);
    ex.printStackTrace();
    updateUndoState();
    redoAction.updateRedoState();
    protected void updateUndoState() {
    if (undo.canUndo()) {
    setEnabled(true);
    putValue(Action.NAME, undo.getUndoPresentationName());
    } else {
    setEnabled(false);
    putValue(Action.NAME, "Undo");
    class RedoAction extends AbstractAction {
    public RedoAction() {
    super("Redo");
    setEnabled(false);
    public void actionPerformed(ActionEvent e) {
    try {
    undo.redo();
    } catch (CannotRedoException ex) {
    System.out.println("Unable to redo: " + ex);
    ex.printStackTrace();
    updateRedoState();
    undoAction.updateUndoState();
    protected void updateRedoState() {
    if (undo.canRedo()) {
    setEnabled(true);
    putValue(Action.NAME, undo.getRedoPresentationName());
    } else {
    setEnabled(false);
    putValue(Action.NAME, "Redo");
    private static void createAndShowGUI() {
    final TextComponentDemo frame = new TextComponentDemo();
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.pack();
    frame.setVisible(true);
    public static void main(String[] args) {
    SwingUtilities.invokeLater(new Runnable() {
    public void run() {
    UIManager.put("swing.boldMetal", Boolean.FALSE);
         createAndShowGUI();
    class JavaFilter extends javax.swing.filechooser.FileFilter
    public boolean accept (File f) {
    return f.getName ().toLowerCase ().endsWith (".txt")
    || f.isDirectory ();
    public String getDescription () {
    return "Fisiere text (*.txt)";

    Hi,
    unfortunatly you cannot change the properties of Action object as you would do with JavaBeans. Instead you have to use the 'put' method.
    eg.:
    myAction.put(Action.SMALL_ICON, new ImageIcon(...));IMHO this was a bad decision, because it's not like the JavaBeans standard and you loose static type information. :-/
    -Puce
    Message was edited by:
    Puce

  • Adding A Separate Background Image For Each Menu Item

    I asked this in the Spry forum, and not sure I understand the answer. Plus, I should have been more specific in asking how to do it, as I'm still pretty new to this stuff. Nothing I'd found indicated it could be done, or how.
    Org question -
    I know you can apply a background image to the menu bar items, but is it possible to add a background image for each individual item? What I'm basically trying to keep are the effects (bevel/emboss, etc.,) that I attached to the text, when I created it in PS CS4.
    Answer -
    Yes you can. The widget is just normal plain html markup so you can just add other classNames or id attributes to the elements. And style the elements through those classes/ids.
    Does this mean I'd have to write a new rule for each menu item? What?
    Thank you.

    Did an Adobe Tutorial for creating/entering a Spry Menu Bar. This is the HTML, after I took out the submenus.
    <ul id="MenuBar1" class="MenuBarHorizontal">
          <li><a href="news.html">Features</a></li>
          <li><a href="news.html">News</a></li>
          <li><a href="news.html">Fashion</a></li>
          <li><a href="news.html">Lifestyle</a></li>
          <li><a href="news.html">Calendar</a></li>
        </ul>
    This is from the SpryMenuBarHorizontal.css (It seems like I need to make changes in the Design Info section of this code. But nothing I've tried has worked):
    /* The outermost container of the Menu Bar, an auto width box with no margin or padding */
    ul.MenuBarHorizontal
    margin: 0;
    padding: 0;
    list-style-type: none;
    font-size: 100%;
    cursor: default;
    width: auto;
    text-transform: uppercase;
    /* 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: 100%;
    position: relative;
    text-align: left;
    cursor: pointer;
    width: 7em;
    float: left;
    /* 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: 8.2em;
    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: auto;
    /* Menu item containers are same fixed width as parent */
    ul.MenuBarHorizontal ul li
    width: 8.2em;
    /* 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;
    /* Menu items are a light gray block with padding and no text decoration */
    ul.MenuBarHorizontal a
    display: block;
    cursor: pointer;
    background-color: #EEE;
    color: #333;
    text-decoration: none;
    /* 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: #33C;
    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: #33C;
    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(SpryMenuBarDown.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(SpryMenuBarDownHover.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;

  • Adding  a drop down menu item?

    Can I add a drop down menu item from the interactive form opening page dropdown list.

    Doug,
    Ah, that's called the Action Menu and at this point there's no way to do that - at least not a supported method. You could always manipulate the "apexir_ACTIONSMENU" list...
    This would make a good enhancement request.
    Regards,
    Dan
    http://danielmcghan.us
    http://sourceforge.net/projects/tapigen
    http://sourceforge.net/projects/plrecur
    You can reward this reply by marking it as either Helpful or Correct ;-)

  • Add-on menu item not added

    Applies to: Firefox 33.0 and 34.0 (beta)
    Platform: Android 4.4.4 on Nexus 5 32 GB
    When I install an add-on that should add an item to the Firefox menu such as Quitnow or LastPass, the new menu item does not show up. With LastPass, that breaks the add-on entirely since you can't log into the service. With Quitnow, the add-on is rendered similarly useless.
    I have tried clearing app cache/data, uninstalling and reinstalling Firefox, and doing a factory reset on the phone. Results were always the same. No other add-ons were installed.
    Is there a method to get these sorts of add-ons to install correctly?

    The issue isn't that I can't close Firefox. I know that can be accomplished other ways, as you stated. The issue is that add-ons such as the ones listed that SHOULD be able to add menu items aren't installing properly/completely. Thus, the LastPass add-on is entirely broken because I can't log in and set it up as this is done via selecting a menu item that isn't there.
    I only brought up the QuitNow add-on because it's another add-on that should add a menu item, but doesn't. Thus it seems to be a general problem with installing FireFox add-ons and not limited to just one add-on.
    There are no Developer Options enabled. I installed Firefox and the extension on a freshly reset phone using the factory image from Google and had the same issue.

  • Start Menu items/shotcuts and Start Menu search ability on multiple workstations

    2/13/2014 our IT department began to receive complaints of missing programs. After investigation of a few users we were able to determine that the programs existed but all shortcuts and items from the start menu had been completely removed. In addition the
    searching feature of the start menu was not functional. This happened to about 90% of our environment and the catalyst seemed to be Windows updates or at least occurred after the auto reboot initiated by Windows Updates.  The only items visible in start
    menu were items added after the fact, internet explorer, magnifier, command prompt, and notepad. All other items, folders, and the ability to search installed programs or folders were completely removed. However all programs are present in the program files
    folders. THe start menu folder in program data was empty except for the aforementioned items. Additionally properties of start menu had all necessary checks in boxes such as search program files and folders etc. Also show hidden items and folders is enabled
    for many users so the items were not hidden but gone. And the biggest kicker of all was after a full domain investigation into the issues we found that the majority of our windows server platforms, primarily 2008, were also affected and system restore is unavailable.
    This conflicts with our idea that Windows Updates caused this since our servers get their updates on a manual initiated basis by their admins which we have not performed as of yet for this month. This caused me to begin looking at SCCM SCEP as all systems
    have System Center Endpoint Protection and received definition updates. Also accessing different user profiles or even a new profile did not make a difference, issue still present.
    Due to the enormous inconvenience we sent out a company wide email asking users to perform system restores to get us in a stable state. A system restore to the day before Windows updates (second Wednesday of every month configured by SCCM SCUP) restored
    the start menu items.
    On a multitude of machines IT performed troubleshooting and system restores recording the changes removed and added. We then, on a healthy machine, started to apply the windows updates and SCEP (antivirus) definitions 1 by 1 with out success of replicating
    the issue. Next we performed a system wide antivirus full scan and did not find any viruses. This is obviously not a system criticle issue bringing us down but is a huge concern for us in IT as it happened company wide and caused a large flux of tickets and
    some down time for non-technical users. We most definitely want to know the cause and after several days of investigation and troubleshooting Im turning to the Microsoft community for help.
    I know I categorized this as a Windows 7 issue and its affecting windows server 2008, 2003, and 7, but I did not see a forum for all windows platforms. Since the majority of affected users are Windows 7 I opened it here.
    So to summarize in a bulleted format:
    Issue: Wide spread issue affecting around 60-70 users and servers, all profiles, were all start menu items save one or two system defaults were removed. Additionally the searching feature for the start menu looks to be broken as programs
    exist in program files and are unsearchable from start menu. IT was also affected and I remain affected until I find the cause.
    Investigation and Troubleshooting:
    Start menu properties: nothing has changed and search options are enabled.
    Missing items are not hidden, hiding and unhiding does nothing and folder options show hidden files is checked.
    Program data start menu location is indeed empty as well as user app data start menu location
    No group policy's are in place altering start menu items and no group policy changes were made as of recent
    No SCCM packages pushed company wide in last month or pushed individually
    Windows Updates occurred on windows 7 machines only before the issue occurred and computers restarted and the issue surfaced
    System Center Endpoint Protection Antivirus updates and definitions deployed just before the occurrence with windows updates. SCEP def updates happen on all windows boxes to include servers
    Paint.exe was completely missing from system32 folder for some users machines to include my own
    System restore to that morning before restarts or previous day fixes the issue for windows 7 users
    No windows updates were initiated on any servers
    Servers were also affected with windows 7 machines
    About half the users affected had corrupt Microsoft Office 2013 Pro Plus Click to Run installations and for some the system restore did not fix this and we had to re-install office for around 10 users
    SCEP antivirus did not catch any viruses that could cause this, I performed MBAM scans on a handful of machines and didn't find anything either.
    Re-creating start menu shortcuts works
    Happened to two of our companies locations NH and MA, all part of the same domain but different LANS of course. Companies are interconnected by MPLS connection.
    I combed through SCCM to see if anything deployed and found nothing. Currently I have SCUP updates and SCEP updates disabled. I will post a list of Windows Updates that occurred when the issue occurred as well as the SCEP updates. I have read all the threads
    about this types of issues and tried all steps without success. Googling the issue also did not rear results.
    MichaelSpaulding

    Hi,
    I would like to suggest you try these steps to figure out what could be causing this problem.
    1. Run Troubleshooter
    Open the Search and Indexing troubleshooter
    http://windows.microsoft.com/en-US/windows7/Open-the-Search-and-Indexing-troubleshooter
    2. Create a new library and include fewer folders for test purpose. Now search for a file from that folder. See if it works.
    Create a new library
    http://windows.microsoft.com/en-US/windows7/Create-a-new-library
    3. Try to rebuild search indexing. Refer the steps from the following article.
    http://windows.microsoft.com/en-US/windows7/Change-advanced-indexing-options
    Also you may use the System File Checker tool (SFC.exe) to check the issue. The sfc /scannow command scans all protected system files and replaces incorrect versions with correct Microsoft versions.
    How to use the System File Checker tool to troubleshoot missing or corrupted system files on Windows Vista or on Windows 7
    http://support.microsoft.com/kb/929833
    In addition, you may refer to the following Microsoft TechNet article for the Windows Search related Group Policies.
    Group Policy for Windows Search
    http://technet.microsoft.com/en-us/library/cc732491(WS.10).aspx
    Hope it helps.
    Regards,
    Blair Deng
    Blair Deng
    TechNet Community Support

  • Is it possible to send data from an external application to a plug-in that executes a menu item?

    I want to pass some parameters from an external appliaction  to my own plug-in. The plug-in creates a menu item for adding electronic signature. The menu item is executed from my external application using MenuItemExecute("mymenutem").

    Since you control the application AND the plugin - you can define ANY method of communication you want.  Shared files, shared memory, IPC, named pipes, etc.

  • Cancel Menu item is alwasys disabled in some A/P windows

    The 'Cancel' Menu item is alwasys disabled in some A/P windows even when the transaction is open or closed.  My question is since I am very limited in the business process knowledge for cancel procedure in those windows:
    Is the Cancel (Data->Cancel) unapplicable on these A/P windows below?
    Goods Receipt PO
    Goods Returns
    A/P Invoice
    A/PCredit Memo
    So SAP Business One does not allow for transactions in these windows to be cancelled regardless of the transaction status?
    I am a developer, I need answer to these in order to do my customization on the event of the Menu item 'Cancel'
    Thanks very much!

    Hi,
    All financial related transactions are not cancel-able. Once documents added, it posted to some G/L accounts. You can only cancel (reverse) those journal entries.
    Thanks,
    Gordon

Maybe you are looking for