How to load other picture in Imageicon

i want to change other picture when the user call the following method, but it does not work. I don't know how to edit it. Can someone teach me how to solve this problem?
ImageIcon onlineIcon = new ImageIcon("image/online.gif");
public void setIcon(String a){
     //System.out.println("..inside the seticon.....\n");
     if(a.equals("online")){
//System.out.println("..inside if.....\n");
          onlineIcon = new ImageIcon("image/online.gif");
     }else{
          //System.out.println("..inside if.....\n");
          onlineIcon = new ImageIcon("image/incomemsg.gif");
}

Ok, you've changed the value of the variable onlineIcon, but that doesn't mean anything is going to get repainted. I assume you are displaying the icon on a JLabel then you would need to add the following code:
label.setIcon( onlineIcon );
This tells the JLabel to use the new icon and repaint itself.

Similar Messages

  • How to load other obejects in flash file after intro using ActionScript 3.0

    How to load other obejects in flash file after intro using ActionScript 3.0 or any other method all in same fla file. see blow intro screen shot ,this one playing repeatedly without loading other fla pages .only way to load other pages is click on Skip intro .see second screeshot below .i need that site to load after intro .
    see codes already in
    stop();
    skipintro_b.addEventListener(MouseEvent.CLICK, skipintro_b_clicked);
    function skipintro_b_clicked(e:MouseEvent):void{
    gotoAndStop("whoweare");
    There is another script there
    /* Simple Timer
    Displays a countdown timer in the Output panel until 30 seconds elapse.
    This code is a good place to start for creating timers for your own purposes.
    Instructions:
    1. To change the number of seconds in the timer, change the value 30 in the first line below to the number of seconds you want.
    var fl_TimerInstance:Timer = new Timer(1000, 30);
    fl_TimerInstance.addEventListener(TimerEvent.TIMER, fl_TimerHandler);
    fl_TimerInstance.start();
    var fl_SecondsElapsed:Number = 1;
    function fl_TimerHandler(event:TimerEvent):void
              trace("Seconds elapsed: " + fl_SecondsElapsed);
              fl_SecondsElapsed++;
    i have no knowledge about these thing ,any help really appreciated .

    Ned Murphy Thank you very Much .It is working .Great advice

  • How to load my pictures as screen savers

    please forgive my ignorance but I totally do not understand what this cloud or iCloud is but i understand one must use it t o load one's own pictures onto Apple TV to use as screen savers.

    You would need to upgrade your Mac to OS X Mavericks and purchase iPhoto '11 from the Mac App store (unless you already have it).  Then you would have to create an iCloud account on your Mac by going to System Preferences>iCloud and signing in with your Apple ID, then check Photos.  Then you can add your photos to your photo stream using iPhoto as explained here: http://help.apple.com/iphoto/mac/9.5/#pht7aaade98.  Once the photos are added to your photo stream, you can sign into your iCloud account on your Apple TV (in Settings>iCloud) and be able to access your photo stream photos for your screen saver (in Settings>Screen Saver>Photos>iCloud Photos>My Photo Stream).
    You might also want to consider waiting until OS X Yosemite is released later this year.  It will include a new built-in Photos app and iCloud will include a new iCloud Photo Library feature (see https://www.apple.com/icloud/preview/).  These are likely to supersede the need to purchase and use iPhoto to accomplish this.

  • How to load a picture in Crystal Report ?

    hi all
    i want load picture in crystal report 10 from path
    example
    i have text1 in my vb form this text = path "C:\image.jpg"
    i need load this path in crystal report picture
    thank you all

    i do not know if this feature is in CR10, as i use CRxi, but if you insert a picture then right click on it, choose graphic options then the picture tab, there is a button where you can enter the graphic location.

  • Building for iOS: how to load other SWFs?

    I have an AS3 app that loads two different kinds of SWFs: linear animations (basically stories consisting of a streaming narration track and still images with pans and dissolves), and SWF games of various types.   I know that CS5.5 can compile to iOS apps. What's not clear to me is how this works in terms of dependent files. Do they also have to be compiled as iOS apps? How does it work when one app requests another Flash sequence? Is this possible?

    Each of the stories is an average of 1mb. Are you saying people won't mind loading 150mb for an app? Although I guess people are used to loading movies, which are considerably larger. Am I just in a "minimal download" mode from the 90's?
    "so size doesn't matter..."

  • How come every other picture and no video backed up?

    I had a factory restore because I upgraded to the OS (is it 6?).  This froze up my iPhone.  In turn I restored images from iCloud.  However, only a few pictures came back (including several taken with the phone), almost every other one.  And, no videos.  Videos have backed up until now.  I'd really like to know why so I can decide whether I advertise for people to not purchase an iPhone and its services.  THis is very upseting as I have followed everything the right way. 
    Thanks!!!

    My carrier is Sprint. But I actually have checked with others and theirs work fine.

  • How to Load other Configuration  file in iPlanet 6.1

    There is directive LoadObjects in iPlanet 4.1 we want similar directive in iPlanet 6.1.
    We do not want to put the application specific (Init functions) in magnus.conf directly.
    Is there a way to load application specific configuration files in Sun Java System Web Server 6.1 or we are forced to edit magnus.conf everytime
    Any help is really appreciated.
    let me know if everyone know any directive or any other way to load coniguration files other than default files (magnus.conf, obj.conf)
    Thanks

    No, unfortunately there is no such directive in Sun ONE Web Server 6.1.

  • How do I get pictures from my camera to my computer using a small card from the camera

    There is a small scan card in my digital camera with the numbers SDHC, which I was told when inserted into my computer would give me instructions on how to load the pictures, which it does not.  I  was given this camera  with no book.
    This question was solved.
    View Solution.

    texaslas,
    Is auto-play enabled?
    You could install Picasa3.9 and it will let you import the pictures.
    If autoplay is enabled for pictures, see Tutorial
    I am a volunteer. I am not an HP employee.
    To say THANK YOU, press the "thumbs up symbol" to render a KUDO. Please click Accept as Solution, if your problem is solved. You can render both Solution and KUDO.
    The Law of Effect states that positive reinforcement increases the probability of a behavior being repeated. (B.F.Skinner). You toss me KUDO and/or Solution, and I perform better.
    (2) HP DV7t i7 3160QM 2.3Ghz 8GB
    HP m9200t E8400,Win7 Pro 32 bit. 4GB RAM, ASUS 550Ti 2GB, Rosewill 630W. 1T HD SATA 3Gb/s
    Custom Asus P8P67, I7-2600k, 16GB RAM, WIN7 Pro 64bit, EVGA GTX660 2GB, 750W OCZ, 1T HD SATA 6Gb/s
    Custom Asus P8Z77, I7-3770k, 16GB RAM, WIN7 Pro 64bit, EVGA GTX670 2GB, 750W OCZ, 1T HD SATA 6Gb/s
    Both Customs use Rosewill Blackhawk case.
    Printer -- HP OfficeJet Pro 8600 Plus

  • How do I load a picture from the clipboard (either Windows clipboard or Labview clipboard) into image data that can then be processed in Labview?

    I want to load a picture from the Windows clipboard (and if not possible, then from the Labview clipboard) into actual numerical image data so that it can be processed in lab view. When I'm at the main screen where I can add controls, I see a section of controls called "Vision" in the tool bar where all the different controls can can be added from. When I go to the control called "Image" and put that on my form, and then look at the flowchart/blockdiagram programing window to see what inputs and outputs it has, I only see one output, and no inputs. And when I right click on it, I see NO way to load an image into the Image control. PLEASE help me.
    Message Edited by Ben321 on 11-09-2008 04:32 PM

    Hi Ben,
    National Instruments has an image processing software called Vision and although I am not completely sure, I think the controls that you found in the control pallet are used in conjunction with the software. Depending on what kind of image processing you want to conduct in LabVIEW, you might want to consider purchasing that product.
    If cost is an issue, there are functions in LabVIEW which allows you to take in image files and process them. However, please keep in mind that the capabilities are limited.
    Images should be loaded onto LabVIEW not via the clipboard but through loading it from folders or directories. (There might be a way to and so if you find a way please let me know! I would like to know myself =D) If you open the function pallet by right clicking on the block diagram, in the programming folder you should find a directory called "Graphic and Sound". There, you'll find functions in which allows you to process images.
     In the "Graphic Type" directory there should be a function called Read JPEG file.vi. There are also others which allows you to read png and bmp files. Please note that there are functions which write as well. Set a file path on the block diagram and inside the "Grahic and Sound" there is a "Picture Function" directory and inside there, there should be a function called "Draw Flattened Pixmap.vi" That changes the image into a format where you can process on LabVIEW. Inside the "Picture Function" directory there are several functions which allows you to process the specified image. Play around with it and see how it goes. And don't forget to Write the file in the end to save any changes.
    I hope this helps
    National Instruments Japan
    Applications Engineer Taiki Hoshi

  • In elements 11, how will I load 2 pictures in the same work space of the photo editor

    in Elements 11, I am working on face swapping, how can I load 2 pictures in the same workspace of the photo editor

    Editor preferences>general>allow floating documents in expert mode, then window>images>cascade or tile. You may need to choose float all in windows the first time before you can make either of those work.

  • How to load pictures computer going to ipad

    how to load pictures from loptop going to i pad?

    This article may help http://support.apple.com/kb/HT4236

  • Whit the new iTunes how i can down load my pictures from the iPhone to the computer  to make more spaces

    whit the new iTunes how i can down load my pictures from the iPhone to the computer  to make more spaces

    Hi shadibader,
    I understand that you wish to import your photos onto your computer from your iOS device. Here is an article for you that will explain how to accomplish this:
    Import photos and videos from your iPhone, iPad, or iPod touch to your Mac or Windows PC - Apple Support
    http://support.apple.com/en-us/HT201302
    Thanks for using the Apple Support Communities!
    Cheers,
    Braden

  • How can I import pictures from my iphone to PC which I imported to the iphone from another PC? The folder doesn't show on my computer. I see all other pictures I took with the phone but not the imported folder.

    How can I import pictures from my iphone to PC which I imported to the iphone from another PC? The folder doesn't show on my computer. I see all other pictures I took with the phone but not the imported folder.

    Photos that were synced from a computer won't show for copying to a computer. If you want to copy them back then you will need a third-party app on your phone such as Simple Transfer which can copy them off via your wifi network. But photos are 'optimised' when they are synced to a device, any that you then copy back to a computer may not be exactly the same as they originally were on your computer (e.g. their dimensions might be different and their colours may look a bit different).

  • Updated IOS 8 to mine and my sons phone and we share an Apple ID but we are now getting each others pictures how do I fix that?

    I Updated my iPhone 5s and my sons iphone 5 to the IOS8 and after we did that we started getting each others text messages which I thjnk I fixed but we are still getting each others pictures, I want to keep him on my Apple ID I just don't want to share pictures and text messages. before the update we didn't have this issue but now we do please help fix this situation!

    Hello cmdenham97
    The question I have is how are using your Apple ID on both of the iPhones. If it is just for purchases, then you can just have that Apple ID for purchases and then have separate accounts for iCloud to sync that data. Check out the article below for more information.
    Using your Apple ID for Apple services
    http://support.apple.com/kb/HT4895
    Regards,
    -Norm G.

  • I purchased two albums from iTunes but neither properly loaded and I cannot play any of the songs.  I have prevously loaded other albums with no problems.  How do I delete these albums and reload them?  I don't see iTunes on iCloud.

    I purchased two albums from iTunes but neither properly loaded on my iPad Mini and I cannot play any of the songs.  I have prevously loaded other albums with no problems.  How do I delete these albums and reload them?  I don't see iTunes on iCloud.

    If the albums do appear in the Music app, hold down on the album icons and the X to delete will pop up on the icons. Tap the X to delete the albums.
    You don't see a anything in iCloud, you see your previous purchases in the purchased tab of the store that you bought the content in. So you find your music purchases in the purchased tab of the iTunes app on your iPad. Tap on Purchased and look for the albums in the Not on this iPad section - assuming that you are able to delete the albums from the device.

Maybe you are looking for

  • Can't run J2EE app on AS 10.1.3

    We have J2EE application based on Toplink/ADF/Struts. Our project is maintained in JDeveloper 10.1.2. We had no serious problems deploying our app to AS 10.1.2. But we cannot deploy it on 10.1.3. server. Before any jsp page shows, this internal error

  • Save the file and give date & time stamp

    1. Reading the Excel file from the selection screen as a parameter. 2. Using F.M. ALSM_EXCEL_TO_INTERNAL_TABLE reading Excel file into     Internal table. 3. Implementing the Business Logic. 4. Move output to Final Internal table. 5. Final internal t

  • Imported JPEG causes ptroblems when publishing

    Still have problems with publishing a FLA with an imported JPEG as a background. It is published OK several times and then on athe next attempt to publish it slows down and throws a message that the computer run out of virtual memory and will take it

  • Authorisation of the static resources OAS10g R2

    Hi, I have some static resources (folders with html and image files) referenced in the web server of my OAS 10g release 2. The alias 'myalias' is defined in the oas10gr2/Apache/Apache/conf/httpd.conf <IfModule mod_alias.c> /myAlias/ "/folder_root/fol

  • How can I drag and move my mouse to 'scrub' away a layer

    Hi, I'm trying to make an interactive animation where when the user clicks and moves the mouse around an area, the opacity of that part of the layer decreases and the user gets to see the background layer. It's similar to the idea of using a brush to