JMenuItem with icon

I'm working on a project that has so emulate a 16 bit RISC microprocessor. And I decided to build an Applet and I created a menu for the applet. The problem is that I can't add icons to the menu items. I tried to add icons for a menu in a frame (stand-alone) application and it worked. But I can't in the applet.
I tried using the following code:
ImageIcon icon= new ImageIcon("icon.gif");
menuitem.setIcon(icon);
And it doesn't work!! :-(
Why? Or you can't use icons in applet menus?

Let's assume you have the icon in the same directory
as the html file the applet's in on the server:
new ImageIcon(new URL(getDocumentBase(), "icon.gif"));
I think just the string argument has to be a file.Thanks a lot! I should have tried that... but I forgot that I had to work with images in an applet. That works..

Similar Messages

  • ALV GRID with icon fields. When exports to Excel, icon fields are emtpy.

    Hi all,
    In our SAP system (6.0 ECC) we've noticed the following behaviour:
    In ALV GRID with icons (color lights for example...) when we export the list to Excel format with the standard button bat, the icon column is always empty.
    We think that in previous SAP version (4.7), the code corresponding to the icon appeared (For example @08@ for green light).
    It's possible to have tha same functionality in this new version like in 4.7?
    Regards.
    Edited by: Ole ES on Nov 17, 2010 6:05 PM

    Hi,
    Check the format in which you export to Excel (MHTML, XML, ...) and try antoher one.
    http://help.sap.com/saphelp_erp60_sp/helpdata/en/66/79ad48157f11d2953700a0c930328a/content.htm
    I think the integrated Excel mode shows '@08@'.
    Best regards,
    Guillaume

  • Problem with Icons

    Hi!
    I'm trying to make a chess game, and I'm having the following problem.
    I have a JLayeredPane that contains a JPanel with other 64 JPanels inside. The pieces are JLabels with Icons.
    The problem is that when I begin a new game, the chessboard appears empty, with no pieces whatsoever, even though those labels are in place.
    If I try to resize just for a bit the main frame, the pieces appear on their positions just like they should in the first place.
    I've tried everything, but they just refuse to appear until I resize the frame (I should add that the chessboard is big enough for the icons to fit, so it is not this .... ).
    Can anyone help?

    So here goes:
    I have an intro frame that has a new game button. When the Button is pressed, I create the main frame, I put in the JlayeredPane and all the other panels and pop up a JDialog message, in which I request certain info. This dialog has an OK button, which should add the labels (with the icons) to the panels on the chessboard.
    I don't think the layout creates this problem, because I've seen it working with exactly the same stucture. The only difference I could see was the dialog box. So I'm guessing this dialog is creating the problem.
    PS: I don't have the code here, I'll get back with that later on.....

  • Tree with Icons

    hi, i need to hava a tree with icons in apex
    is it possible?

    hi, First of all You have to create table .
    CREATE TABLE "APEX_PAGES"
    (     "IDENTIFIER" NUMBER(10,0) NOT NULL ENABLE,
         "PAGE_NO" NUMBER(10,0) NOT NULL ENABLE,
         "PARENT_PAGE_NO" NUMBER(10,0),
         "NAME" VARCHAR2(4000) NOT NULL ENABLE,
         "NAVIGATION" VARCHAR2(100) NOT NULL ENABLE,
         "IMG" BLOB
         CONSTRAINT "APEX_PAGES_PK" PRIMARY KEY ("IDENTIFIER") ENABLE
    then create form with report on table apex_pages.
    Please note : - P20_IMG is an form item name...
    use following sql query for tree with image :
    select PAGE_NO id,
    PARENT_PAGE_NO pid,
    '<img src="'||*APEX_UTIL.GET_BLOB_FILE_SRC*('*P20_IMG*',IDENTIFIER)||'" />'||NAME name,
    'f?p=&APP_ID.:'||page_no||':&SESSION.' link,
    null a1,
    null a2
    from APEX_PAGES
    Also u can highlight the current node ................
    select PAGE_NO id,
    PARENT_PAGE_NO pid,
    CASE WHEN page_no = :APP_PAGE_ID THEN
    '<img src="'||APEX_UTIL.GET_BLOB_FILE_SRC('P20_IMG',IDENTIFIER)||'" />'
    ||'<b>'||NAME||'<blink>'||'<font color="red">'||' <='||'</font>'||'</blink>'
    ELSE
    '<img src="'||APEX_UTIL.GET_BLOB_FILE_SRC('P20_IMG',IDENTIFIER)||'" />' || NAME END
    AS name,
    'f?p=&APP_ID.:'||page_no||':&SESSION.' link,
    null a1,
    null a2
    from APEX_PAGES
    Cheers !!!!!

  • Good file-manager for OpenBox? (with icons)

    I tried rox with the magickthumbnails and videothumbmails, but havent got it working yet.
    I am now trying thunar, but it has dull generic icons.  Everything looks like a piece of paper.  I'm sure it'd look good if I was running XFCE.
    Is there a standard/common file-manager for use with openbox?  Preferably one with icons for different file-types.

    DonVla wrote:
    hi,
    i also recommend rox. fast and the drag'n'drop functionality is brilliant.
    the default layout is truely ugly. but you can change everything.
    i've changed the rox icons by hand:
    in my ~/.gtkrc-2.0.mine:
    # rox-filer toolbar icons
    pixmap_path "~/.icons/panel_icons/icons_2"
    style "normal" {
    stock["gtk-close"] = {{"close.png"}}
    # stock["gtk-close"] = {{"exit.png"}}
    stock["gtk-go-up"] = {{"1uparrow.png"}}
    stock["gtk-home"] = {{"gohome.png"}}
    stock["gtk-refresh"] = {{"redo.png"}}
    stock["gtk-zoom-in"] = {{"add.png"}}
    stock["gtk-zoom-fit"] = {{"stop.png"}}
    stock["gtk-jump-to"] = {{"bookmarks.png"}}
    # stock["gtk-sort-ascending"] = {{"bottom.png"}}
    # stock["gtk-help"] = {{"help-icon.png"}}
    stock["rox-show-hidden"] = {{"filter.png"}}
    stock["rox-show-details"] = {{"view_tree.png"}}
    # stock["rox-select"] = {{"select-icon.png"}}
    widget "*" style "normal"
    it's quite self explanatory .
    vlad
    ps:
    and that's what it looks like:
    http://img206.imageshack.us/img206/2949 … 24aak4.png
    That's a pretty cool setup u got there. Is that conky in the top centre? If so, mind sharing your .conkyrc.
    What Icon theme are u using? is that panel-thingy AWN?
    Could u also elaborate this line < pixmap_path "~/.icons/panel_icons/icons_2" > ?

  • I chose a theme and would like my home page to be a blank tab, but show the theme with icons on it instead of a white page. What is the use of having a cool theme if you never see it. Is this a posibility?

    I chose the theme purple moon. I was hoping that the home page could be set up customized with icons of my most used websites and tool icons where you can see the theme, but the only think I can set it to is a blank white page.

    I have now recently downloaded 10.0.2 which is confusing in itself, as, as far as I can ascertain that is actually version 11, but I'm not even sure about that.
    Version 10.0.2 is the newest version and the successor to GarageBand '11 (version 6.0.5).
    The '11 is referring to the iLife '11 suit of multimedia application - the older GarageBand was a part of this bundle.
    Have a look at Edgar's graphical enhanced manuals, the explain very detailed how things work and why. You can buy them as iBooks from the iBook store or directly from the page:
    http://DingDingMusic.com/Manuals/

  • How to display the selection screen with icons as well as with text element

    How to display the selection screen with icons as well as with texts (written in text elements) for PlantDate, OrderType,WareHouse..

    Report zex33.
    type-pools: icon.
    selection-screen begin of line.
    selection-screen comment 1(20) text_001.
    parameters: p_werks type marc-werks.
    selection-screen end of line.
    selection-screen begin of line.
    selection-screen comment 1(20) text_002.
    parameters: p_whouse(10).
    selection-screen end of line.
    selection-screen begin of line.
    selection-screen comment 1(20) text_003.
    parameters: p_auart like vbak-auart.
    selection-screen end of line.
    initialization.
      write ICON_PLANT  as icon to text_001.
    concatenate text_001 text-001 into text_001 separated by space.
      write ICON_WAREHOUSE  as icon to text_002.
    concatenate text_002 text-002 into text_002 separated by space.
      write ICON_ORDER  as icon to text_003.
    concatenate text_003 text-003 into text_003 separated by space.

  • How to Handle Data with Icons

    I'm trying to create a directory of showroom locations and the type of products that they carry. I need an efficient way to manage the data (like an Access database) but I need to represent the product categories with icons. My team has drawn the icons in Illustrator and I have considered using a utility to create a custom icon font, but those custom icon fonts are web-fonts only and it appears that they cannot be used in the database directly.  The final output needs to be in a printable format. Any suggestions on how to solve this? Do I need someone to write a custom script to run in InDesign?

    Hard to say without seeing the layout, but perhaps Data Merge would work-- you can place images using data merge. Another possibility is to use some sort of text symbol, then use Find/Change to replace with contents of the clip board after copying an icon.
    Or make your own font with a better utility: Indiscripts :: IndyFont

  • Mail stopped working. Now get blank screen with icons (delete, file, forward, etc) at top. Then goes blank. iPad 2 purchase 12/11

    Mail stopped working. Now get blank screen with icons (delete, file, forward, etc) at top. Then goes blank. iPad 2 purchase 12/11

    Try to reset your ipad and/or force quit the mail app
    Reset
    Hold down the sleep and home keys for about 20 seconds. When you see the silver apple, let go and let it reboot. No data will be lost.
    Force close an app
    Double tap the home button. When you see the app previews on the screen scroll sideways if needed to get the preview in question on the screen. Flick that preview up and off the screen to close the app. Single tap the home button or home screen preview to exit the mode.

  • JButton with Icon question

    In the Toolbar I have a JButtons. I created the JButtons with Icons.
    When I click on a button it is putting a dotted line right around the Icon. How can I get rid of that? Thanks.

    You're talking about the focus rectangle. If memory serves in the SwingSet demo there's an entire panel devoted to buttons and such. You can find something there to help you. The toggle in the example is labeled "Paint Focus", and it does what you want.

  • Treeview datawindow with icon - performance issue

    Hi all,
    i have a treeview dw and have set the "use tree node icon" property with 2 different icons (bmp) at the first level (when the level is expanded or collapsed)
    Then a different icon (ico) file is used for the second level
    Unfortunately, this is causing a huge performance issue when i run the application.
    If i disable the "use tree node icon" property, everything works fine.
    Is there any known issues on the treeview dw with icons? any work around?
    am using pb11.2
    thanking you in advance,
    -a

    First question is which jdev version you are using?
    I made a quick test and did not see a long busy state.
    Run your app with -Djba.debugoutout=console as java option. You get more output in the log window, but may be some hint about what's going on.
    Timo

  • Multiple JMenuItems with same text

    I have a menu bar with several menus each of which has a JMenuItem with the same
    string.
    ex. Track Run
    get config file get config file
    How do I know which JMenue Item was selected in my event handler.
    Is this a no no.
    Should I have:
    ex. Track Run
    get track config file get run config file
    Thanks, pa_ul

    You can do the following:
    1. use separate listeners
    2. Explicitly set the action command on your menuitems
    3. Use ActionEvent.getSource();

  • Non Resizable JDialog with icon

    Hi All...
    How to create dialog with icon on the top left corner and also this dialog should be non resizable.
    Thanks
    sanjay

    Use setResizable(false) to make the dialog non-resizable.
    The Dialog automatically inherits the icon of the parent Frame/Dialog which is passed in the constructor.

  • JButton with icons

    I need to create JButton with icon but have not much idea. Is there any code sample that may give me some insight? Any help is appreciated in advance.Thanks.

    Icon play = new ImageIcon("images/Play24.gif");
    JButton PlayButton = new JButton(play);

  • Customed JButton size with Icon

    Hi,
    I want to place a few buttons in a JPanel in a fashion that it looks like a toolbar, my problem is that these buttons (with icons) take the size they want.
    But I would like to size them like I want (they would have all the same size though).
    Is there any layoutmanager that would let me do that or any other suggestions!?
    Thanks.

    I'm not sure this is what you want but...
    You can use the setPreferredSize method on the buttons and make sure they have enough room.
    Also, the GridLayout places components in areas of equal size.
    Andrew

Maybe you are looking for

  • Opening a .pdf file from Excell 2011 hyperlink

    I have a problem opening a .pdf file hyperlinked in Excel 2011 file. The message is: "No program is registered to open this file". If I go from explorer the file is regularly opened with Adobe Reader.

  • Exception branch in a block without cancelling the process

    Hi all. I have an integration process with a Block where I process a multiline message interface. Inside the block, exception branch for controlling errors is used. When exception is thrown, the process of the pendant elements in the block is cancele

  • How to connect to itunes from school computer

    I am a primary school teacher trying to copy the apps from iPad to computer. However it wont connect to itunes store and therefore says i do not have permision, I assume that this is problably due to the proxy server. Has anyone got any ideas on how

  • Why are input-output lights flashing when not in use? Pirated signal?

    I have my airport base station set up to not make itself public (ie. you must type the name of the network and password for it to appear and let you in). However, I noticed the other morning when I got up (in the dark!) that the lights were flashing

  • 24" LED Camera Versus MacBook Pro Camera.  Can you choose?

    I have built-in iSight cameras in both my MacBook Pro and my 24" LED display. Photo Booth uses the laptop's camera. iChat uses the big screen camera. Is there a way to choose which camera should be active for a given app? When using the LED screen, I