Swing - dynamically update an Image

Hello


I have 2 Gif-images.
1st appears immediately at the start of the stand-alone java.
2nd should replace the one 1 dynamically, when an action occurs.

a 1:
        URL urlOfImage = this.getClass().getResource("/images/loading_icon_begin.gif");
        ImageIcon loadIconmage = new ImageIcon(urlOfImage);        
        loadButton = new JButton(loadIconmage); // global variable        
        loadScrollPane = new JScrollPane(loadButton);  // global variable

        loadScrollPane.setBounds(259, 10, 150, 30);
        myContent.add(loadScrollPane);
a 2nd:
        URL urlOfImage = this.getClass().getResource("/images/loading_icon_animated.gif");
        ImageIcon loadIconmage = new ImageIcon(urlOfImage);
        loadButton.setIcon(loadIconmage);
        loadScrollPane.getViewport().setView(loadButton);
But it does not work! The 2nd image is not displaying.

Thank you, a.

asked exactly that question recently before, or why do you say "have you ever read the answers.

Watch your previously sent questions and show me where you have "accepted" an answer or where you said "thank you for the help.

// loadButton.updateUI();
// loadButton.repaint();
// loadScrollPane.getViewport().setView(loadButton);

None of the lines of code above is necessary. To update the icon of a visible component all you need to do is call the setIcon (...) method of this element.

To learn more create a [url http://sscce.org] NBS, which illustrates the incorrect behavior.

Tags: Java

Similar Questions

  • Using #WORKSPACE_IMAGES # with the names of dynamic list of Image, not to hardcode

    I hope someone can help me with this request.

    I am developing an Apex application but I am learning as I go along by examples of Google search and read the tutorials, etc.  I am trying to create a slideshow based on a dynamic list of Image names. First, I created an apex_collection in a header containing the names of the image process, I need (view/column APEX_COLLECTIONS. C001) I then created a Page called P81_IMAGE_NAME element. I'm trying to loop through the collection and display the pictures in a slide show.   I have a HTML Page with the following code in the Source of the region (found the code in an example online)... Please can someone tell me where I can add the following PL/SQL code so that #WORKSPACE_IMAGES # nom_image may contain the names of images dynamically recoveries rather then hard-coded image names as in the < div Section of the Source region - Code I want to add somewhere, don't know where it add or even if it will work

    Declare cursor c1 is

    Select c001

    of apex_collections

    where collection_name = "CO_IMAGES";

    Start

    A1 to c1 loop

    : P81_IMAGE_NAME: = c1. C001;

    < img src = "#WORKSPACE_IMAGES & P81_IMAGE_NAME" alt = "Slideshow Image" / >

    end loop;

    end;

    -End

    -The code which displays images, I found (Harcoded in the < div section)

    < script type = "text/javascript" >

    function slideSwitch() {}

    var $active = $("#slideshow IMG.active");

    If ($active.length == 0) $active = $("#slideshow IMG:last");

    This allows to take images in their order of appearance in the tag

    var $next = $active.next () .length? $active.next)

    : $('#slideshow IMG:first');

    Uncomment the 3 lines below to shoot images in random order

    var $sibs = $active.siblings ();

    var rndNum = Math.floor (Math.random () * $sibs.length);

    var $next = $($sibs [rndNum]);

    $active.addClass('last-active');

    $next.css ({opacity: 0.0})

    .addClass ('active')

    . Animate ({opacity: 1.0}, 3000, function() {})

    $active.removeClass ('active last active');

    });

    }

    {$(function()}

    setInterval ('slideSwitch()', 3000);

    });

    < /script >

    < style type = "text/css" >

    / * the value width and height to match your images * /.

    {#slideshow}

    position: relative;

    height: 400px;

    }

    #slideshow IMG {}

    position: absolute;

    top: 0;

    Left: 0;

    z index: 8;

    opacity: 0.0;

    }

    {IMG.active #slideshow

    z-index: 10;

    opacity: 1.0;

    }

    {IMG.last - active #slideshow

    z index: 9;

    }

    < / style >

    < div id = "slideshow" >

    < img src = "" #WORKSPACE_IMAGES #Logo.png "alt =" slideshow Image 2 "/ >" "

    < img src = "" #WORKSPACE_IMAGES #Logo1.png "alt =" slideshow Image 1 "/ >" "

    < img src = "' #WORKSPACE_IMAGES #2_Burg - 1.png" alt = "Slideshow Image 2" / > "

    < img src = "" #WORKSPACE_IMAGES #Car11.jpg "alt =" slideshow Image 3 "/ >" "

    < img src = "" #WORKSPACE_IMAGES #Screen1.png "alt =" slideshow Image 4 "/ >" "

    < / div >

    < / div >

    user8016921 wrote:

    Please update your profile of the forum with a recognizable user name: Video tutorial how to change username available

    Always include the information described in these guidelines when you post a question: How to get the answers from the forum

    I am developing an Apex application but I am learning as I go along by examples of Google search and read the tutorials, etc.  I am trying to create a slideshow based on a dynamic list of Image names. First, I created an apex_collection in a header containing the names of the image process, I need (view/column APEX_COLLECTIONS. C001) I then created a Page called P81_IMAGE_NAME element. I'm trying to loop through the collection and display the pictures in a slide show.  I have a HTML Page with the following code in the Source of the region (found the code in an example online)... Please can someone tell me where I can add the following PL/SQL code so that #WORKSPACE_IMAGES # nom_image may contain the names of images dynamically recoveries rather then hard-coded image names as in the

    Depends on the number of images. How are they involved?

    With a small number (e.g. 10-20), you can simply use a page element to register the handset img reference items and she as a substitution string in the region existing HTML. For more information, it would be preferable to use a report.

    On the approach of page element:

    1. create the point P81_IMAGES of the page as an element of the display only. The value of the Condition Never element so it is not included in the rendered page and the security attribute point escape special characters No.

    2. create a page process before header (sequenced to run once the collection created if that is done at this point in the process):

    begin
    
      :p81_images := null;
    
      for img in (
        select c001 src
        from apex_collections
        where collection_name = 'CO_IMAGES')
      loop
        :p81_images := :p81_images || 'Slideshow Image '
      end loop;
    
    end;
    

    3 refer to the value of the element in the HTML source of the region

    
    
    
    
    
    &P81_IMAGES.
  • Can I update the image of factory restore?

    Hi all

    I recently had the pleasure to make a 'factory restore' on a M100 and an A300.

    While the process went smoothly (even if the A300 recovery disk creator should not be put back first to make it work), data that has been restored were, of course, obsolete because he didn't understand not updates either the operating system (Vista Home Basic) or to one of the Toshiba Software (including drivers and tools utility).

    I know that you can return the system to Toshiba for a new image of the HARD drive by them (at great cost), but I don't know if that provides a picture of 'update' or if she simply replaces the original image (obsolete).

    Is it possible the 'factory restore' image stored on the recovery partition can be updated and a user, or a technician of the 'non-Toshiba"without having recourse to external software such as Acronis?

    Thanks in advance for all advice offered.

    Hey Buddy,

    No, you can update the image of factory restore t. Settings (Windows, driver, etc.) are stored in an image that can t be changed or updated because these settings are pre-tested on your laptop computer and any change would be not compatible. In addition, I think that Windows updates are made with two or three clicks, you need just to a good internet connection. Alternative, you install Microsoft's latest Service Pack which contains many important updates ;)

    By the way: I made my own image using Acronis image. After the installation of recovery disk Toshiba I removed all applications that I n t need (ConfigFree for example), installed the Windows updates and my other apps that I need (Skype, Office, etc.). After that, I tested the laptop a bit and finally and especially that I created an image with Acronis. So I can restore my own settings every time too. ;)

  • Hello, I am creating a mini site for a client via muse, is it possible that it could be updated (adding images) without muse by passer?

    Hello, I am creating a mini site for a client via muse, is it possible that it could be updated (adding images) without muse by passer?

    Hello noutcall19,

    If you intend to replace the existing images in the site then you can certainly do it with the help of InBrowserEditing, but it is not possible to add new images by using InBrowserEditing.

    https://helpx.Adobe.com/Muse/using/in-browser-editing-websites-third-party-hosting.html#up meetings % 20 a % 20website % 20Selon % 20 In-Browser % 20Editing

    Kind regards

    Vivek

  • Dynamic update of Web parts

    Hello

    I would like to know if it is possible to dynamically update the Web fields.

    For example:

    If the user clicks on the button '+ 1', the 'value' field will become = "value" + 1

    If the user clicks on the button '-1' the field 'value' will become = 'value' - 1

    Thanks in advance,

    Geert

    No guides on this subject and don't know any specific sites that do. I just do it if necessary.

    You just need to two buttons and increment or decrement the input value onClick.

    As a not jQuery's javascript

  • Dynamic selection of images for OBIEE 11 g report

    Hello dear colleagues,

    need help to solve a problem with the dynamic selection of images for reports OBIEE 11 g.
    For OBIEE 10 g, it works perfectly - put images in

    *'\ < HOME_ORACLE_BI > \web\app\res\s_oracle10\images'*

    Directory and enter edit the column formula (in the answers) of the expression:

    * ' < table_name > '. "" < table_column > | ". jpg'*.

    and selecting

    URL of the image (in the properties of column-> Data Format)

    retrieve the images appropriate for the corresponding model (the project is for fashion retail customer) regarding the description of the specified column (for example * "DM_ITEM".) «MODEL_CODE ' ('09361' = *) put correspondence the name of the image file (* '09361.jpg' *).»

    For the OBIEE 11g (installed on W7, DWH on MSSQL 2008R2, VM in the field), I followed the link * "http://vikramwalia.wordpress.com/category/obiee-11g/" * and stuck at the step where the browser should recover image (s) based on the following address:

    *' http://localhost:9704/analyticsRes/product / *.

    Dive into the issue, I checked the staticports.ini and in the * [WEBLOGIC] * section find the following message is displayed:

    *#The port of 'content' for the most part POET. This is the Weblogic managed server port on which BIEE applications are deploie.*
    Oracle WLS BIEE managed Server Port No. = 9704

    that seems to be OK...

    The netstat command response confuses me much since I found (and also of external) record for TCP Local address (should be < IP localhost >: 9704), which lead me to the point that, probably one of the OBIEE 11 g services not started OR I made a mistake during installation of OBIEE 11 g, although the system did not send a message about this possibility. BTW, the BI Publisher on this machine works correctly.

    So, kindly ask support or advice on this subject. Thank you
    AL

    Published by: user7374943 on 29.04.2013 01:01

    Published by: user7374943 on 29.04.2013 02:15

    Published by: user7374943 on 29.04.2013 02:19

    Not able to open the IAM blog you referred to above.

    Make sure that you have deployed the analyticsRes component as shown in http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/bi/bi1113/customizing_obiee11g/customizing_obiee11g.htm. Create a folder called produced under analyticsres and start accessing images.

    Good luck...
    Isabelle Renon

  • How dynamically update the role of oracle using the trigger

    How dynamically update the role of oracle using the trigger:

    I have svmanger owner of schema in the database. There are five tables belonged to svmanager.

    Table A, B, C, D, E.

    I have a role that is played only to these tables under the scheme: SVMANAGER_READ_ONLY

    now, if I create a new table F under svmanager. the role that svmanager_read_only does not work is updated, so the user had assigned role cannot access table F.

    is there a way to create the trigger for this role dynamically update any when a table is created or deleted?

    Thank you.

    I really really really don't suggest to do this - it's a bad habit. If possible I'd just adding the grant as part of the steps to the role on the new creation of the table.
    But for fun here's how you can accomplish this:

    create or replace procedure execute_grant(v_ddl in varchar2)
    is
    begin
       execute immediate v_ddl;
    end;
    /
    
    create or replace trigger catch_create_table_trg after create on schema
    DECLARE
    
    ddl_job number;
    ddl_str varchar2(50);
    begin
       IF ora_dict_obj_type = 'TABLE' THEN
    
           ddl_str := 'GRANT SELECT ON '||ora_dict_obj_owner||'.'||ora_dict_obj_name||' TO SVMANAGER_READ_ONLY';
    
           dbms_job.submit(job => ddl_job,
           what => 'execute_grant(''' || ddl_str || ''');',
           next_date => sysdate+(5/24/60/60));
    
       END IF;
    end;
    /
    

    Test it

    create table F (id number(1));
    

    Validate

    select * from ROLE_TAB_PRIVS where ROLE = 'SVMANAGER_READ_ONLY';
    
  • Best way to update the images using PHP / MySQL?

    Hello
    I want to update the images using PHP/MySQL, so users can update their images and maybe a few others, but especially images.
    Thank you

    Hi, you can try this "How update an image in mysql"

  • Updating multiple images to process 2010

    I'm sorry if requested before - is there a way to update many images to the most recent process without having to open each individually?

    Just highlight all the images that you want to update.  Make sure that automatic synchronization is enabled.  Then, switch on the 2010 process in the file that has the main focus.

  • How dynamically update stage height according to contained elements

    By default, HTML, items acquire their height according to their content.  From what I can tell, edge animate creates percent or hard-coded according to the heights for the scene.

    Is it possible to automatically adjust the height of stage based on the content of the animation?

    In my explorations, I was able to assign a new value hardcoded to the scene by setting its CSS (in my case via the .animate method) as such:

    sym.$('Stage').animate({height: "560px"},1500, "swing");
    

    This was added to a click event for an object that triggers the animation of the object to play(), allowing it to expand.

    I want to be able to do is to monitor the size of the animated object and translate that into size of degree (also by adding a few pixels of padding).

    I came across the Timeline.update event, which must check the timeline to each period.  My question is how to use it at the same time acquire the current size of the object store it long enough to add 10 or if the pixels, then apply it at the height of the scene?  It would be similar to the jQuery .slideDown method.

    The reason why I would do this is because I have a project which, as the clicks of the user on the different options in an organization chart, will reveal additional content to the left, right, and down and this will all be contained in a web page layout.  I would like to avoid having a blank solid on the bottom of the page when the page loads.

    By trial and error, I have determined that it is possible to access the html elements that aren't in the entertainment on board.

    So good that now I did when a button is clicked, the scene of edge increases to set the size (calculated, not dynamically, but manually based on the combined elements on the stage height.)  My code is:

    if (click2 == false){
    click2 = true;
    sym.getSymbol('Option2').play();
    sym.$('yes1').css({"cursor":"default"});
    sym.$('Stage').animate({height: "1290px"},100, "swing");
    var frameHeight = document.getElementById('column2').clientHeight + 300;
    $('#column2').animate({height: frameHeight},100,"swing");
    }
    

    I still think it would be nice if I didn't have to encode it as much, especially since the Animation of edge can be assigned to an appropriate scale and can cause additional and unnecessary space.

  • Is it possible to dynamically update the price of the product when the visitor selects a new attribute of product?

    I'm fighting to get the price of the product to be updated dynamically when a visitor selects an attribute of the product in the menu dropdown.

    Has anyone successfully put in place?  With the help of javascript (JSON tags?) I see that the examples have been provided to change the image of the product - but not the price of the product. ()http://helpx.adobe.com/business-catalyst/partner/product-inventory.html()

    Help or direction would be greatly appreciated. Thank you very much.

    Was looking for my previous post and came on this thread, I hope that if someone of other googles in there is a solution in this thread:

    Re: Product attributes price calculator

  • Dynamic Popup of Image extension

    Hi, anyone know of a free dynamic popup extension out there? So far, other image extensions that I found all require a .jpg file. I use it for a dynamic page and need to use it with a dynamic attribute < img src = "#photos.primaryImage1 #" >.

    Thank you

    Shane

    Hi, extension of the Bill is the dynamic image popup ($3) almost free only out there to see, I've looked everywhere and if you need something that works slick with MySQL, then this is it. I thought I'd add the fields width and height in my table photo was going to be negative, but in reality it was a real plus. By setting the default value of any size 4:3 image you can custom tailor the pop-up to be any size you want. It worked very well for my application.

    I got an email back from Michael also on the extension of dbJustSoPWbMX.mxp and at the moment he does not intend on update for CF.

    Thank you Bill again for the entrance, also diouda.fr is a great site!

    Shane

  • Update the images download Photos problems after 30 December 15

    "Of the photos' on my iMac now won't download pictures from my sandisk memory card, after the update today 30 Dec 15.  Please can someone advise/help?  I tried pictures, then re-opening, closing, but all that happens is very briefly the memory card appears as if the download, then 'photos' back to my library of images.

    Thanks in advance!

    Bridget

    What OS do you have? What photo software?

    The memory card moved to the finder? If so, use the finder to get the photos off the card and import them - and then reformat the card

    LN

  • First try the producer consumer Architecture: continuous play and dynamically update settings.

    Hello

    I am currently working with two instruments; an Agilent E3646A and a NI 6212 BNC. My goal is to have the 6212 continuously take measures according to predefined parameters while the E3646A parameters can be continuously updated. This combination simple instrument aims to help me learn the manual architecture; continuous measurement, output dynamic controls and instruments more will be added in the future.

    I've already posted on a similar, but more complicated configuration (http://forums.ni.com/t5/Instrument-Control-GPIB-Serial/Split-second-lag-when-controlling-two-instrum... and was advised to try the producer consumer Architecture.) I found the documentation on the website (http://www.ni.com/white-paper/3023/en/, https://decibel.ni.com/content/docs/DOC-2431), searched the forums and built my own VI. While my first attempt at a producer consumer Architecture has solved some of the problems I had when I posted on the subject, however, new questions have been raised regarding the reading and adoption of the VI.

    I am currently able to run the VI and update the settings on the device. Previously, I'd get a freeze while the instrument has been updated and could not switch settings until it was done. This has been resolved, although that reading updates only when a parameter has been updated, although it is outside the structure of the event. In addition, the Stop button does not in any context. I also got occasional mistakes on the part of Deqeue, but the major part of the sentence is error-200279 'A tried to read samples that are no longer available' to DAQmx Read. I realize that there is a problem in my loop of producer but have not been able to find a way to solve it.

    This is my first attempt at a producer consumer Architecture and already I can see that it is a powerful tool. I read as much as I could and looked at examples, but should have some problems at the beginning. Would be very grateful of any advice so I can take full advantage of the architecture.

    Hope to hear from you,

    Yusif Nurizade

    You're going to overflow this buffer, unless the events are generated faster than "sample rate/number of samples.   Period.  Nothing could be simpler.

    You don't need a local to stop your curls.

    Try something like this attachment.  I simply moved the structure of the event in its own loop dedicated since it had nothing to do with acquiring data at all.

    Data acquisition loop stops very well when you destroy the task and destrying the stops of power queue (sending the default values of the queue for the power control) for EXAMPLE, to ADD a group of setting 'Safe shutdown' to a 'package' and it wire to the Center terminal (Prototype).

  • dynamically update task settings

    Hello

    I create a VI to control a stepper motor by varying the frequency of output for the engine.  Above certain frequencies, the motor requires an enjambements ramp to reach the desired frequency.  So I want to configure my VI for the ramp slowly (speed of rise of 1 kHz per second).  I have a while loop and inside I call DAQ create virtual channel (CO Pulse Freq), then a VI calendar implicit to generate samples continues, and then I call early.  Basically, another while loop checks the status of the task and waits for 1 second.  What I see is that the frequency for the acquisition of data entry create vi virtual channel changes, but the output frequency does not change since no change in speed is found on the engine. However, if I stop the task after the 1 second wait, the frequency entry takes effect and different speed is observed on the engine, with a slight delay in the response.  The delay is undesirable because it defeats the purpose of the continuous rise.

    I'm looking for, so essentially a way to update the settings of task dynamically without any delay/mark a pause.

    Does anyone have a suggestion?  Thank you in advance.

    Channel property node actually cannot change the parameter during execution of the task.  If you put a probe on the frequency entry, it seems that the value is updated, but if you actually connect a scope on the physical output channel, the value is not changed.

    I discovered that to change the setting on the fly, I use writing DAQ vi the task.

    Thanks for looking into it for me.

    Lei

  • Maybe you are looking for