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

Similar Messages

  • Xfce4 missing icons for menu items

    My xfce4 seems to have blank icons for some of the menu items and I can't figure out why. I installed the entire xfce4 and xfce4-goodies groups.

    maggie: are you talking about icons in the Applications menu applet? If yes, are the icons missing for applications which do not provide icons¹? If yes, then you have the answer: there is no icon displayed because there is no icon to display for the entry.
    AFAIR, the pre-4.12 Applications menu applet displayed some ugly stock icon as a placeholder, but it seems that this behaviour is no longer present in the latest release. If you truly want icons for the entries, you may set them by editing corresponding .desktop entries. The best way is placing your overrides in ~/.local/share/applications as this will not pollute pacman-managed /usr/share/applications directory.
    ¹ See the corresponding .desktop entry in /usr/share/applications/ or ~/.local/share/applications

  • IMac 20" 10.4.11 blurry photos, blurry icons, missing menu items, etc

    iMac 20" running 10.4.11, Was running perfectly, took Skype out of startup items, from then on photos are blurry, icons blurry, dock items blurry, minimize/maximize buttons in open windows are blurry, and items are missing from drop down menus....any ideas what could have happened? There are currently no items in startup items, what should be in there?

    Could be many things, we should start with this...
    "Try Disk Utility
    1. Insert the Mac OS X Install disc, then restart the computer while holding the C key.
    2. When your computer finishes starting up from the disc, choose Disk Utility from the Installer menu. (In Mac OS X 10.4 or later, you must select your language first.)
    *Important: Do not click Continue in the first screen of the Installer. If you do, you must restart from the disc again to access Disk Utility.*
    3. Click the First Aid tab.
    4. Select your Mac OS X volume.
    5. Click Repair. Disk Utility checks and repairs the disk."
    http://docs.info.apple.com/article.html?artnum=106214
    Then try a Safe Boot, (holding Shift key down at bootup), run Disk Utility in Applications>Utilities, then highlight your drive, click on Repair Permissions, reboot when it completes.
    (Safe boot may stay on the gray radian for a long time, let it go, it's trying to repair the Hard Drive.)
    If perchance you can't find your install Disc, at least try it from the Safe Boot part onward.

  • Using photoshop elements 9 on a lenovo yoga 2 with retina display is impossible - too small icons and menu items

    can you help me?
    greetings
    werner

    I can completely understand this guy's frustration with the clickpad, it is completely unusuable with the default settings. I played around with the synaptics settings and it is much better now, I just adjusted the FingerHigh and FingerLow options:
    synclient FingerHigh=46
    synclient FingerLow=46
    With these settings, the cursor doesn't twitch around anymore when you try to click something.

  • How do I edit and create new Spry2 menu items?

    I have manged to use adobe air to style and insert a spry2 menu - looks OK
    However,I do not undestand how to edit the menu items
    i.e. creating new menu items and adding new sub menu items
    On spry1 it was easy - just click the top of the menu and a wizard appeared at the bottom of the page
    The spry2 menu icon seems to be unclickable/greyed out?
    Can anyone help
    [email protected]

    Thanks for the reply - I already thought of that and I can edit the menu using code view (although I am not sure how you would 'see the sub menus in design view?) but I was wondering if spry2 has the same time saving wizard in the properties panel (as Spry1) that simplifies and speeds up the process?
    To restate the question: I can see a spry2 menu icon in the properties panel but it doesn't do anything as it's greyed out.
    Is there an option in dreamweaver (or adobe air which styles the menu) that makes a menu wizard work in the properties panel?
    If not then I guess I have to do it in code view - very tedious!?
    Jonathan
    [email protected]

  • New Menu Item entry in Standard Help Menu

    Hi experts,
    I have added a custom menu item under the standard Help menu of SAP using SE41 (Menu Painter) with pragram name: MENUSYST and status: MEN
    I added the new entry and gave it a function code and activated the function code as well as the interface MENUSYST.
    This worked fine and the entry is visible at the desired location. Now on click of this new entry, I need to open a URL. I had a look at the HELP_START function module but modifying that to call the URL on click of the new menu item, would require an access key.
    Is there any other method available to accomplish the task?
    Regards,
    Reema.

    Hello,
    Basically I need to open a Custom Web Dynpro Application that I have created. Also I need to pass the trannsaction code as a parameter in the URL of the WDABAP Application.
    Pl help me proceed.
    Regards,
    Reema.

  • Missing menu item attachment list in GOS regarding purchase order

    Hello All,
    I customized the archiving for different kinds of documents.
    There is all quite good for example with sales orders or invoices. I can call the transaction codes to view a speacial document - in those cases VA03 / VF03 - , click on the special GOS-icon and select from the drop-down menu the attachment list. The attachment list opens as a popup and there I see all created PDF documents.
    Only with purchase orders it won't work. Calling the ME23N and clicking on the GOS-icon the menu item attachment list is not active (light grey). With administration transaction OAAD I can see that there are archived PDF documents. So, the archiving works but still not the viewing of archived purchase orders.
    How can I activate the attachment list in this case? Maybe I forgot to do something?
    Thank you very much for your help!

    Hi,
    Check if note 1506581 is present in your system,if not please implement the same.
    Also check if in /SPRO -> IMG Customizing -> "Integration with
    our mysap.com components" -> Supplier Relationship Management ->
    Message Control -> "Activate Document Transfer"
    the customizing is correctly set for BUS2012 (Purchase Order).
    If not, please maintain this entry correctly and re-test the
    scenario.
    Regards,
    Ashwini.

  • No icons on menu bar

    I previously had spotlight, time, language, ect. icons on the menu bar but now there is only the gmail icon. I tried clicking on the options of adding icons on menu bars, but it doesn't work. For example, i click "show time and date" and when i switch panes, it resets itself. Spotlight and others doesn't work either. So if anybody can help, I really appreciate it.

    Hi, Dale —
    Seems as if there've been a lot of folks lately who've encountered problems with SystemUIServer — the process that manages the right-hand side of the menu bar.
    Troubleshooting this may require several rounds of interacting. For now, try these:
    (1) Delete the preferences file ~/Library/Preferences/com.apple.systemuiserver.plist, restart, and reset as required in System Preferences
    (2) Disable all "system enhancers" — including especially any 3rd-party Menu Extras — that you may have installed. Some of these may show up in System Preferences »» Other. In particular, disable or uninstall Application Enhancer (APE) if it's there.
    Please post back to share your progress, and we'll take it from there
    HTH!
    Regards,
    Dean

  • Can't find "Endnote Citation" in the INSERT menu item

    I wanted to insert a citation or bibliography in my report using Pages but I can't find the feature in Pages to do this.  From the help, it stated going to INSERT then select "Endnote Citation" but in my Pages, under the INSERT menu item, I can't find "Endnote Citation". 
    I am using Macbook Air 2010, and Pages 09.  Please help.
    8irons

    Apple includes download links to some very useful documentation with each of the iWork '09 applications. You'll find it in the Help menu. Each User Guide is a searchable PDF document packed with useful information on using the application.
    On page 52 of the Pages '09 User Guide, the topic of Footnotes and Endnoted is discussed:
    Adding and Editing Footnotes and Endnotes
    In a word processing document, you can add special marks (numbers or symbols)
    that link to notes at the bottom of a page (footnotes) or at the end of a document or
    section (endnotes).
    You can’t mix footnotes and endnotes in a document, but you can convert notes from
    one type to the other.
    (emphasis added)
    The Footnotes menu item in the Insert menu serves to insert markers for either type of note.
    Regards,
    Barry

  • How to add an Icon to a parent menu item in Command Center?

    Hi guys,
    does anybody know how to add an icon to a parent maenu item in Command Center? BTW, I'm using SBO 6.5
    Cheers,
    Oki

    The SDK doesn't provide any features for adding icons to the command center in SBO6.5.
    Version 2004 has a new image property for menu items that can be used.
    John.

  • Menu Item Icons

    Hi,
    I was wondering if there was a simple way to add an icon to the specific items in the menu bar. I see that there is a property in the portal file to select an active, inactive, and rollover image; but using them will replace the page/book title. I would like to have both an icon and the title visible.

    Hi
    Try one more thing using the css file(s). Take any existing look and feel like default big horn look and feel. Add that to your project from Project Explorer View. By default all the files are in shared modules for look and feel stuff. Overwrite custom.css file with specific stuff related to Menu. First try just by changing like Fontsize, color for the Menu Items. Then you can modify .css files entries for Menu by adding Icons images in css file itself. If you want to control specific menu items only with different icons, you can do more customization.
    http://download.oracle.com/docs/cd/E13155_01/wlp/docs103/portals/develop_ui_lookfeel.html#wp1032617
    http://download.oracle.com/docs/cd/E13155_01/wlp/docs103/portals/develop_ui_lookfeel.html
    http://download.oracle.com/docs/cd/E13155_01/wlp/docs103/portals/develop_ui_lookfeel.html#wp1059262
    Thanks
    Ravi Jegga

  • Add menu item or icon to PA30

    Hello,
    Is it possible to add a menu item or an icon in the toolbar to add your own functionality to transaction PA30? I am trying enhancement PBAS0002 but I don't think that's it...
    Gr,
    Jaron Frenk

    Hi Jeron,
    Depends on what you want to do.  To change icons, you can use SE51-Screen Painter if you have a Developer Key.  Adding new tabs and and infotypes to those tabs is simple configuration - IMG: Personnel Management --> Customizing Procedures --> Infotype Menus --> Infotype Menu --> Infotype Menu.  Here you set up which infotypes appear on which tabs.  In the second step Determine Choice of Infotype Menu, you define which tabs appear in PA30. 
    So the question is - What are you trying to accomplish in PA30?
    Paul

  • Windows and icons are black, menu items are not showing correctly

    Hello!
    Well just doing my normal routine today browsing the Internet, watching videos on vlc, my computer suddenly started to glitch. Icons were disappearing, Safari turned black.
    So i did a restart but the problem is still there. I cant even choose the user properly because the avatars are not there it's just all dark gray. Remembering where my user avatar is, i do a click and type in my password and I do and able to get in to my system but all windows menu items and icons are black.
    Basically what I'm saying is the system seems to be working fine except for that I can't see the icons and windows properly displayed.
    I've already tried to reinstall of Mavericks hoping that it's a software thing. You guys think it's a problem with the graphic processor?
    Any help or suggestions will be appreciated thank you.

    Please read this whole message before doing anything.
    This procedure is a diagnostic test. It changes nothing, and therefore will not, in itself, solve your problem.
    Third-party system modifications are a common cause of usability problems. By a “system modification,” I mean software that affects the operation of other software — potentially for the worse. The procedure will help identify which such modifications you've installed, as well as certain other aspects of the configuration that may have a bearing on the problem. Don’t be alarmed by the apparent complexity of these instructions — they’re easy to carry out and won’t change anything on your Mac. 
    These steps are to be taken while booted in “normal” mode, not in safe mode, if possible. If you’re now running in safe mode, reboot as usual before continuing. If you can only boot in safe mode, you can still use this procedure, but not all of it will work. Be sure to mention that in your reply, if you haven't already done so. 
    Below are instructions to enter UNIX shell commands. The commands are safe and do nothing but produce human-readable text output, but they must be entered exactly as given in order to work. If you have doubts about the safety of the procedure suggested here, search this site for other discussions in which it’s been followed without any report of ill effects. I am not asking you to trust me. If you can't satisfy yourself that these instructions are safe, don't follow them.
    The commands will line-wrap or scroll in your browser, but each one is really just a single long line, all of which must be selected. You can accomplish this easily by triple-clicking anywhere in the line. The whole line will highlight, and you can then copy it.
    Note: If you have more than one user account, Step 2 must be taken as an administrator. Ordinarily that would be the user created automatically when you booted the system for the first time. Step 1 should be taken as the user who has the problem, if different. Most personal Macs have only one user, and in that case this paragraph doesn’t apply.
    Launch the Terminal application in any of the following ways: 
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.) 
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens. 
    ☞ Open LaunchPad. Click Utilities, then Terminal in the icon grid. 
    When you launch Terminal, a text window will open with a line already in it, ending either in a dollar sign (“$”) or a percent sign (“%”). If you get the percent sign, enter “sh” and press return. You should then get a new line ending in a dollar sign. 
    Step 1 
    Triple-click anywhere in the line of text below on this page to select it:
    { echo "Loaded kernel extensions:"; kextstat -kl | awk '!/com\.apple/{printf "%s %s\n", $6, $7}'; echo $'\n'"Loaded user agents:"; launchctl list | sed 1d | awk '!/0x|com\.apple|org\.(x|openbsd)|\.[0-9]+$/{print $3}'; echo $'\n'"Inserted libraries:"; launchctl getenv DYLD_INSERT_LIBRARIES; echo $'\n'"User cron tasks:"; crontab -l; echo $'\n'"System launchd configuration:"; cat /e*/lau*; echo $'\n'"User launchd configuration:"; cat .lau*; echo $'\n'"Login items:"; osascript -e 'tell application "System Events" to get name of login items' | sed $'s/, /\\\n/g'; echo $'\n'"Safari extensions:"; /usr/libexec/PlistBuddy -c Print L*/Saf*/*/E*.plist | awk -F'= ' '/Bundl/{print $2}' | sed 's/\..*$//;s/-[1-9]$//'; printf "\nRestricted user files: %s\n" $(find ~ $TMPDIR.. \( -flags +sappnd,schg,uappnd,uchg -o ! -user $UID -o ! -perm -600 \) | wc -l); echo $'\n'"Extrinsic loadable bundles:"; cd; find -L /S*/L*/E* {,/}L*/{Ad,Compon,Ex,In,Keyb,Mail/Bu,P*P,Qu,Scripti,Servi,Spo}* -type d -name Contents -prune | while read d; do /usr/libexec/PlistBuddy -c 'Print :CFBundleIdentifier' "$d/Info.plist" | egrep -qv "^com\.apple\.[^x]|Accusys|ArcMSR|ATTO|HDPro|HighPoint|driver\.stex|hp-fax|JMicron|print|SoftRAID" && echo ${d%/Contents}; done; echo $'\n'"Unsigned shared libraries:"; find /u*/{,*/}lib -type f -exec sh -c 'file -b $1 | grep -qw shared && ! codesign -v $1' {} {} \; -print; echo; ls -A {,/}L*/{La,Priv,Sta}* L*/Fonts; } 2> /dev/null | open -ef
    Copy the selected text to the Clipboard by pressing the key combination command-C. Then click anywhere in the Terminal window and paste (command-V). I've tested these instructions only with the Safari web browser. If you use another browser, you may have to press the return key after pasting.
    The command may take up to a few minutes to run, depending on how many files you have and the speed of the computer. A TextEdit window will open with the output. Post the contents of the TextEdit window (not the Terminal window) — the text, please, not a screenshot. You can then close the TextEdit window. The title of the window doesn't matter, and you don't need to post that. No typing is involved in this step.
    Step 2 
    Remember that you must be logged in as an administrator for this step. Do as in Step 1 with this line:
    { echo "Loaded system agents:"; sudo launchctl list | sed 1d | awk '!/0x|com\.(apple|openssh|vix\.cron)|org\.(amav|apac|cups|isc|ntp|postf|x)/{print $3}'; echo $'\n'"Login hook:"; sudo defaults read com.apple.loginwindow LoginHook; echo $'\n'"Root cron tasks:"; sudo crontab -l; echo $'\n'"Log check:"; syslog -k Sender kernel -k Message CReq 'GPU |hfs: Ru|I/O e|find tok|n Cause: -|NVDA\(|pagin|timed? ?o' | tail | awk '/:/{$4=""; print}'; } 2> /dev/null | open -ef
    This time you'll be prompted for your login password, which you do have to type. Nothing will be displayed when you type it. Type it carefully and then press return. You may get a one-time warning to be careful. Heed that warning, but don't post it. If you see a message that your username "is not in the sudoers file," then you're not logged in as an administrator.
    You can then quit Terminal.
    To prevent confusion, I'll repeat: When you type your password in the Terminal window, you won't see what you're typing.
    Note: If you don’t have a login password, set one before taking Step 2. If that’s not possible, skip the step.
    Important: If any personal information, such as your name or email address, appears in the output of these commands, anonymize it before posting. Usually that won't be necessary.
    Remember, Steps 1 and 2 are all copy-and-paste — no typing, except your password. Also remember to post the output as text, not as a screenshot.
    Please post the contents of the TextEdit window, not the Terminal window.

  • Shorten Menu items to make room for more icons in menu bar

    Is there any way to shorten the menu items in the menu bar, so that there will be more space for the icons? For instance, in Safari, the first Menu item, File, could be abbreviated to F, Edit could be E, etc. That way, the shortcuts for apps through icons in the menu bar would have more space, to permit more icons to be shown.
    An option, although not a full fledged one, would be to configure the icons in much the same way as in the dock, drag and drop them to the desired location.
    Any thoughts on this?

    Not possible by normal methods - some hacking is required.

  • Menu item icon not updating

    Hi,
    I have an action into which I set an Icon:
    action.putValue(Action.SMALL_ICON, icon1);
    now I set this action into my menu item and show the item in a menu. The item displays correctly and the icon is visible.
    later in the program i do:
    action.putValue(Action.SMALL_ICON, icon2);
    then I open the menu but the menu item still shows icon1 until I roll over it with the cursor when it finally changes to icon2.
    Any ideas on how to make this update immediate?
    BTW at the point of changing the icon, I don't have access to the menu item or the frame etc, just the action.
    Thanks a lot,
    Jim

    Anyone got any more ideas?Maybe you have a programming problem, but we can't see your code so we don't know for sure.
    If you need further help then you need to create a [url http://homepage1.nifty.com/algafield/sscce.html]Short, Self Contained, Compilable and Executable, Example Program that demonstrates the incorrect behaviour, because I can't guess exactly what you are doing based on the information provided.
    And don't forget to use the [url http://forum.java.sun.com/help.jspa?sec=formatting]Code Formatting Tags so the code retains its original formatting.

Maybe you are looking for

  • Voice Memos Don't Sync

    I'd like to use my iPhone 4 for dictation. But to do so I need to be able to pull the memos out through the computer because they are too long to email. I cannot seem to sync them through iTunes. I have read the other posts on this. I have gone to th

  • "Save attachments" button in Mail has disappeared

    My "Save attachments" button in Mail (6.6/1510) disappeared the other day. It has always been there, sitting on the dividing line between message header and message content. But now it's gone. All of a sudden. Sure, it becomes visible if I select det

  • BAPI_PO_CHANGE Question

    Hello All, Is it possible to uncheck certain indicators, such as the delivery complete indicator (ekpo-elikz) using the BAPI_PO_CHANGE?  For example, the Purchase Order has the delivery complete checked (ekpo-elikz = 'X') and we want to remove the ch

  • Reorder User Profile properties in SharePoint 2013.

    Hi, I have created custom user profile properties in SharePoint 2013 under User Profile Service Application, now I want to change the order of properties as well as also want to move OOTB properties and custom properties from one section to another s

  • Using iPad2, when receive photo in e-mail it displays OLD photo instead.

    Using iPad2, when receive photo in e-mail it now displays OLD photo that had been received and saved instead. Why and how to rectify?