JOptionPane getting it's icon

I have created a JOptionPane and I am trying to get it's icon. I read that the icon was driven by the message type so why is the icon null? Better yet, how can I get get the error icon that it uses. That's my goal. This is what I have done
String message = "msg";
JOptionPane pane = new JOptionPane(message, JOptionPane.ERROR_MESSAGE);
JDialog dlg = pane.createDialog(null, "title");
Icon icon = pane.getIcon();
//the Icon is null  BOOOO 
//if I add do this then the icon shows up... uhm... icon is bound in the show.  How is does show get it?
dlg.show();

you can use :
UIManager.getIcon("OptionPane.questionIcon")
UIManager.getIcon("OptionPane.errorIcon")
UIManager.getIcon("OptionPane.informationIcon")
UIManager.getIcon("OptionPane.warningIcon")

Similar Messages

  • I have a windows 7 pc using itunes 10.6 how do i get the speakers icon on my itunes

    I have loaded airport utility but I rescan nothing.  I can't get the speakers icon to display in itunes.  I'm running windows 7 64k version
    Steve

    I think I may not have explained the problem correctly . The duplicate music is on my Itouch.  I do not have any duplicate music on my Itunes.   I did do as you instructed yesterday and there was none.  I have a feeling this has to do with the Cloud or some other new feature of OS5.  Its weird too because I did just buy a new album off of Itunes and it did not happen.  Just with the music I had purchased before I downloaded OS5.  If i have to, I'll make an appointment at the Apple store, I just don't have time to do it this week.  I really appreciate your help tho!

  • HT201335 I am only getting the AirPlay icon when I am in ITunes.  It does not show up when on my Mac when ITunes in not on the screen.  There is no Icon at the top of my computer. How do I fix it?

    Can someone tell me how to get the AirPlay Icon on the toolbar at the top of my screen?  It only shows up when I am in Itunes.

    The airplay icon you are reffering to is for mirrorring your desktop.  It is a functionality of Mountain Lion and it seems, based your profile, that you are still using Lion.  Therefore, you will need to purchase and upgrade to 10.8 in order to get this function.
    Be sure your iMac is really mid 2011 as it will be the oldest to support the mirrorring function.  Apple TV 2 or later is also required.

  • When I turn on my iMac it comes up with the icon which I then log into. The password works and I then get the apple icon and the spinning wheel. After a minute it turns into a prohibited icon. If I log on the guest icon I get to Safari. Help!

    When I turn on my iMac it comes up with the login icons which I then choose and log into. The password works and I then get the apple icon and the spinning wheel. After about a minute the Apple icon turns into a prohibited icon. However, if I log in under the guest icon, I can access the wifi and get to Safari. I really don't know what to do next. Any help would be gratefully appreciated.

    Are you running any A-V? If it's an iMac 21.5, I don't think you're running Leopard, 10.5. Probably at least Snow Leopard, 10.6. This is the Leopard forum.
    This article says meant for 10.3.9 and eariler, but contains some still useful suggestions.
    http://support.apple.com/kb/TS1411
    Try a Safe Boot. Shift at the startup chime and expect a much longer time to boot. This will bring you to a login screen with "Safe Boot" in red.
    Look at this as well.
    http://support.apple.com/kb/TS1417

  • I can't get Google (word & icon) to load in the search bar on my home page. How can I fix this?

    Starting a few weeks ago every time I load my home page in Firefox (v20) the search bar, next to the right side of the address bar, comes up what I call blank. It's just a small blank sheet of paper with the upper corner turned down. What should be in that search box is the icon and word "Google". When the icon and the word Google doesn't load I can't type any web address in the address bar and change to that web site. Also, when I bring down the menu of previous web addresses from the address bar and click (highlight) one of them nothing happens either. I have tried about everything I can find on this or that I can think of and so far nothing has worked. Once in a while I might get the Google icon & word to come up like it's supposed to in the search bar but it won't stay. It might last the rest of a given evening but the next time I bring up my home page it's gone. I really NEED help on this.
    Thanks for any help or suggestions for this problem.

    Try to use the SearchReset extension to reset some preferences to the default values.
    *https://addons.mozilla.org/firefox/addon/searchreset/
    Note that the SearchReset extension only runs once and then uninstalls automatically, so it won't show on the "Firefox > Add-ons" page (about:addons).
    If you do not keep changes after a restart then see:
    *http://kb.mozillazine.org/Preferences_not_saved

  • How do I get the website icon to stay on the desktop?

    When I save a webpage to my desktop, via "drag webpage address to desktop", the website icon is replaced by a mozilla icon.
    How do I get the website icon to stay on the desktop?

    You can try to toggle the browser.shell.shortcutFavicons pref on the <b>about:config</b> page.
    *http://kb.mozillazine.org/about:config

  • How do I get the PDF icon to show on all of my PDF files?

    how do I get the PDF icon to show on all of my PDF?

    Generally the icons are a selection that is set in MS Explorer (on the PC). Depending on the version of windows, there are various ways of getting at the properties related to an icon, including what application would open the file.

  • How do I get the Airplay Icon to show on the System Preferences of my MacBook Pro?

    How do I get the Airplay Icon to show on the System Preferences of my MacBook Pro? I want to be able to connect to my AppleTV.

    I looked at that already. I've done everything it says: check to make sure wireless is working, make sure airplay is enabled, make sure device and apple tv are on the same network blah blah. The icon just isn't there. Unless I skipped a step. AirPlay works when I use it in the music app and in the video app, I jus can't get mirroring to work. I was looking at some other threads and mirroring doesn't seem to be working for a lot of people. Maybe I jus have to wait for an update =\

  • How do i get the syncing icon to stop

    how do i get the syncing icon to stop?

    I had. Turned out it was the "preview new tabs option", which I guess has changed since I last updated. Thanks though.

  • How do I get the brightness icon to go away on my MacBook?

    How do I get the brightness icon to go away on my MacBook?

    Welcome to the Apple Community.
    If your problem persists get yourself a micro USB cable (sold separately), you can restore your Apple TV from iTunes:
    Remove ALL cables from Apple TV. (if you don't you will not see Apple TV in the iTunes Source list)
    Connect the micro USB cable to the Apple TV and to your computer.
    Open iTunes.
    Select your Apple TV in the Source list, and then click Restore.

  • How do I get the device icon to show in the itunes  app?

    How do I get the DEVICE icon to appear back in the itunes app as when I plug in my ipod it doesnt show the device icon?

    Hi...
    Help here > iOS: Device not recognized in iTunes for Windows
    Start with restarting the Apple Mobile Device Service first.

  • How do I get the music icon to show up on the home page? in the settings icon it shows I have all my songs downloaded.

    How do I get the music icon to show up on the home page of the touch?  Under the settings icon it shows the songs are downloaded.

    - Move the Music app icon to the home page.  It is usually easer to do it on the computer than on the iPod itself. The manual says how to move the apps.
    iPod touch User Guide (For iOS 5.0 Software)
    - I do not undersand what: "Under the settings icon it shows the songs are downloaded." means.

  • How do I get the speaker icon to STAY in my system tray?

    How do I get the speaker icon to STAY in my system tray?  Every time I mute the speakers, the icon disappears from my system tray.  I have a very difficult time getting it back, and I can never remember how I do it.  Can someone give me some helpful, easy to remember steps on how to KEEP the sound/volume icon in my system tray?  Thanks.
    Candy-Iowa
    Compaq Presario CQ62-214NR Notebook PC
    Windows 7 64-bit operating system

    Candy-Iowa wrote:
    I did what you said.  There is not a "system icons to always show".  What it does say is "turn system icons on or off".  The one for the sound icon is greyed out and CANNOT be clicked on.  This happens every time I mute the speakers.  
    So, how do I get it back?  
    Candy
    In the menu that said "turn system icons on or off", try clicking on the blue writing on the bottom left of that menu that says "restore default icon behaviors".

  • How do I get the Firefox icon to stay on the bottom bar of my Mac?

    How do I get the Firefox icon to stay on the bottom bar of my Mac computer?

    You can try to toggle the browser.shell.shortcutFavicons pref on the <b>about:config</b> page.
    *http://kb.mozillazine.org/about:config

  • How do I get the "Notes" icon to appear on the task bar or Launchpad?.....late 2010 air

    How do I get the "Notes" icon to appear on the task bar or Launchpad?.....late 2010 air

    Ref: How do I get the "Notes" icon to appear on the task bar or Launchpad?.....late 2010 air
    Thanks for the input.
    Search field produces no "notes" file
    "Notes" icon does not appear in the applications folder
    I can not find the "notes" icon anywhere.
    Ideas?

Maybe you are looking for

  • Which Hard Drive for MacBook Pro 5,5?

    Hi everybody! I bought a brand new MacBook Pro 5,5 (13,3", 2.53GHz C2D, 4GB RAM, 250GB HD) from an iStore on December 2009. It was a Xmas present from me to myself. I use it mainly for music-video recording and editing with Logic Express, Final Cut X

  • Discoverer 10g error when scheduling a workbook using 2 calculations

    When I schedule in discoverer 10 g using 2 calculations it return this error ora-01722 Invalid Number If I schedule the workbook with only one of the calculation it run perfectly. If I run the query manually using the 2 calculations it run perfectly.

  • EEWB Enhancement Error while adding new field

    Hello Experts ,                      The requirement is to add the attachment feild in the support desk message screen (CRMD_ORDER) in the Fast track tab , although in the transaction tab already the document option is available for attachments the e

  • Im getting an error in my console

    Mar 11 18:24:44 kodys-imac-g5 mDNSResponder: ERROR: getOptRdata - unknown opt 4 so this error popped up like i dont know how many times in my console today till 19:38:23 can anyone tell me what this means? i have no idea should ignore it or should i

  • How can I move photos off my ipod to iphoto?

    My ipod has photos on it that have disappeared out of my iphoto library. I'd like to move them from the ipod to iphoto. Possible? How?