Writing an ActionListener that responds when a variable changes

I am interested in writing an ActionListener that monitors the value of a variable. When the value of that variable changes, I want the ActionLiastener to kick in and change what is displayed in a JLabel on the display. Note that there is no user interaction throughout this process.
Has anyone done this before or have any insight? I assume that ActionListeners are the way to go, but in case they are not, is there another way?
Thanks!

ActionListeners, by their very nature, listen for user actions; if there is no user interaction, they won't do anything. When you update the variable, why not just update the JLable too? Just make sure you do it on the Event thread (might need to use SwingUtilities.invokeLater()) and you might need to explicitly tell it to repaint itself. Hope this helps.
Jamie

Similar Messages

  • Refresh FR report when Substitution Variable change

    Hi All,
    Is there any way to refresh FR report which are opened through smart view/ workspace when the Substitution Variable changed. Like if my report opened for the Year = Curryear and now curryear value is FY14 if I changed curryear as FY15 will it reflect on my FR report that already opened.
    Regards,
    Pradipta

    For sure it won't be updated automatically if the report is open. Did you try changing it and then see what happens?
    You'll have to refresh the report for the subvar to show up on the report.
    P.S remember to stop and start your Essbase application after the subvar change
    Regards
    Celvin Kattookaran

  • Variable updating when another variable changes. How to keep it static?

    I'm missing something very basic here I think. What's happening is that I'm looping through a list. I also need to update that list, but since I don't want to update the list I'm looping through, I created a temporary list to hold the new values. Then after I'm done looping, I'll update my original list with my temporary list.
    I started out by defining/setting the variables:
    <defvar name='matchedAccessLevels'>
         <ref>
              <concat>
                   <s>user.accounts[FACILITIES].properties.locationMap[</s>
                   <ref>theLoc</ref>
                   <s>].accessLevels</s>                                                            
              </concat>                                                       
         </ref>                                                       
    </defvar>
    <defvar name='tempAccessLevels'>
         <ref>matchedAccessLevels</ref>                    
    </defvar>Then I loop through. Below are the results from the log with block trace. It looks like whenever I update tempAccessLevels, it's updating matchedAccessLevels. The whole point of using tempAccessLevels was so that matchedAccessLevels remained static. What am I missing? What do I need to do differently to keep matchedAccessLevels from changing? I've tried many different combinations of code and still matchedAccessLevels is changing whenever I update tempAccessLevels.
    <cond>
         <eq>
           <ref>theLoc</ref> --> Milwaukee
           <s>Milwaukee</s> --> Milwaukee
         </eq> --> 1
         <block trace='true'>
           <set name='matchedAccessLevels'>
              <ref>
                <concat>
                   <s>user.accounts[FACILITIES].properties.locationMap[</s> --> user.accounts[FACILITIES].properties.locationMap[
                   <ref>theLoc</ref> --> Milwaukee
                   <s>].accessLevels</s> --> ].accessLevels
                </concat> --> user.accounts[FACILITIES].properties.locationMap[Milwaukee].accessLevels
              </ref> --> [Mail Room, Provider Audit File - Door 3142, Cost Reports - Door 3127]
           </set> --> null
           <set name='tempAccessLevels'>
              <ref>matchedAccessLevels</ref> --> [Mail Room, Provider Audit File - Door 3142, Cost Reports - Door 3127]
           </set> --> null
           <dolist name='theAccessLevel'>
              <ref>matchedAccessLevels</ref> --> [Mail Room, Provider Audit File - Door 3142, Cost Reports - Door 3127]
              <cond>
                <eq>
                   <ref>theAccessLevel</ref> --> Mail Room
                   <s>Mail Room</s> --> Mail Room
                </eq> --> 1
                <block trace='true'>
                   <remove name='tempAccessLevels'>
                     <s>Mail Room</s> --> Mail Room
                   </remove> --> null
                   <ref>tempAccessLevels</ref> --> [Provider Audit File - Door 3142, Cost Reports - Door 3127]
                   <ref>matchedAccessLevels</ref> --> [Provider Audit File - Door 3142, Cost Reports - Door 3127]
                   <append name='tempAccessLevels'>
                     <s>Center Hall to NGS Far N Dr</s> --> Center Hall to NGS Far N Dr
                   </append> --> null
                   <ref>tempAccessLevels</ref> --> [Provider Audit File - Door 3142, Cost Reports - Door 3127, Center Hall to NGS Far N Dr]
                   <ref>matchedAccessLevels</ref> --> [Provider Audit File - Door 3142, Cost Reports - Door 3127, Center Hall to NGS Far N Dr]
                   <defvar name='isAccessLevelUpdated'>
                   </defvar> --> null
                </block> --> null
              </cond> --> null

    Ok, xpress objects are really Java objects and, as in Java, are handled by reference.
    When you are setting tempAccessLevels, you are setting it to refer to the same list object as matchedAccessLevels.
    A convenient way to actually copy a list is with the append function. eg:
    <defvar name='tempAccessLevels'>
    <append>
         <ref>matchedAccessLevels</ref>     
    </append>               
    </defvar>

  • Logic not responding when saving or changing settings & Can't record audio

    I have just started to use Logic for the first time (installed it a month ago and now trying to use it).
    I have the latest version of Logic, OS X and have a MacBook Pro.
    I do not have any external hardware or plug-ins installed.
    PROBLEM:
    Whenever I try to save or save as a song (even when there is no MIDI or Audio in the tracks) the colored pinwheel spins forever.
    I also was trying to figure out how to record audio. I discovered that there was no path for recording audio which might be the problem why I couldn't get it to record (see below), and when I clicked the select path button it also froze on the spinning pinwheel.
    Audio Recording Problem:
    I set one of the default Audio tracks to Input 1 (built-in microphone) and I see the monitor responding to sounds, but when I turn on the record button on the track and then click record, the mic is still working but nothing is recorded in the track. When I open Garageband and record it works perfectly fine.
    Help?

    I had many problems with my Mac G5 2.7 refurb/Logic 7.2.1 when I first got it back in March. Although my problems were different than yours some things I remember doing that helped:
    Trashing Logic's preferences fixed a situaution where my Logic windows were flashing randomly and Midi info was corrupted causing my Mackie Control Universal and my Korg Triton to freak out Logic.
    Repairing disk permissions because 2 times Logic did not totally install correctly. Yes I reinstalled Logic at least 4 times to figure out why I was having freezeups system wide.
    Working closely with Apple Care documenting my problems and finally getting my local Apple store in our local Mall to change out the motherboard, dual processors and optical drive. Yes essentially a new computer. Since that time I have not had one system wide freezeup (any wood around here)
    or major problem.
    AT one point running the "Quick Test" from Apple's startup disc showed a Bad RAM chip. Again not related to you but running the test could show something.
    I have 2 issues left to fix - Logic 7.2.1 for me has a transposition problem. Midi tracks will show up after I open a song file transposed down a step. The fix is to reboot Logic which is a pain. 2nd - Annoying beep coming from my power supply. Beep is audible in studio near the tower and is also in the audio chain coming out of speakers. No fix yet but again I'm working with Apple Care.

  • IPhoto stops responding when preferences are changed

    I'm having a very strange problem on my wife's Macbook, running OS 10.5.5 with iPhoto 7.1.4. Initially, iPhoto was freezing up (spinning beach ball) as soon as it was opened, and did not function at all. I can fix this problem by deleting the iPhoto plist preferences file, but the same thing happens again as soon as I open the iPhoto preferences window and try to change any preferences. iPhoto then remains broken (same as initial symptoms) until the plist file is deleted again.
    I have tried the following potential fixes, none of which have worked:
    1. Delete the iPhoto plist preferences file. This only fixes the problem until I try to change any preferences.
    2. Rebuild the library. This didn't make any difference at all.
    3. Open iPhoto with a new, blank, library. This didn't make any difference at all.
    4. Repair disk permissions. This didn't make any difference at all.
    5. Completely removed iPhoto using AppCleaner then reinstalled and updated to 7.1.4 again. This didn't make any difference at all.
    Any other ideas?

    Have you applied the latest iLife Support updater, iLife Support 8.2 ?
    TIP: For insurance against the iPhoto database corruption that many users have experienced I recommend making a backup copy of the Library6.iPhoto (iPhoto.Library for iPhoto 5 and earlier) database file and keep it current. If problems crop up where iPhoto suddenly can't see any photos or thinks there are no photos in the library, replacing the working Library6.iPhoto file with the backup will often get the library back. By keeping it current I mean backup after each import and/or any serious editing or work on books, slideshows, calendars, cards, etc. That insures that if a problem pops up and you do need to replace the database file, you'll retain all those efforts. It doesn't take long to make the backup and it's good insurance.
    I've created an Automator workflow application (requires Tiger or later), iPhoto dB File Backup, that will copy the selected Library6.iPhoto file from your iPhoto Library folder to the Pictures folder, replacing any previous version of it. It's compatible with iPhoto 6 and 7 libraries and Tiger and Leopard. Just put the application in the Dock and click on it whenever you want to backup the dB file. iPhoto does not have to be closed to run the application, just idle. You can download it at Toad's Cellar. Be sure to read the Read Me pdf file.
    Note: There's now an Automator backup application for iPhoto 5 that will work with Tiger or Leopard.

  • Text that responds to the Increase/Decrease font size buttons

    How do I create text that responds to the Increase/Decrease Font Size buttons in the browser? None of the pages respond to these buttons.

    I'm not sure iWeb produces text that responds to the size change buttons. I check some of my pages and none respond. And these are text boxes that have not been converted to images.
    Message was edited by: Old Toad

  • Reload a method during a variable change

    I want to run a method when a variable changes.. Some sort of
    listener on the variable.. Something like that.. Is it possible?
    Any ideas?

    One way to do this is to use a setter function. to the
    outside, it looks just like a variable, but is really a function in
    which you can do whatever you want. It has a special format:
    [Bindable]private var _sMyString:String;
    public function set myString(sValue:String):void {
    _sMyString = sValue; //normal variable stuff
    //now do whatever special processing you need to do.
    Use this property like this
    myString = "someValue";
    or:
    this.myString = "someValue";
    or
    myClass.myString = "someValue";
    You can also look into changeWatcher()
    Tracy

  • Functions triggered on variable change

    Hi there!
    It's surely something quite easy, but couldn't find exactly
    what I wanted; it must be related to the eventListener thing, but
    don't know how to do it:
    I'd like several movie clips to react (each one in its own
    way) when a variable changes; say I've got a website that needs to
    be editable when the var _root.vAdmin = "yes" and not when the
    latter equals "no"; so I need multiple functions situated anywhere
    to be triggered when the variable _root.vAdmin changes; any idea?
    Thanks in advance!

    seems like this is what you need. look into EventDispatcher
    or AsBroadcaster classes
    tutorial:
    http://www.kirupa.com/developer/actionscript/eventdispatcher.htm

  • Demo Error when creating or changing configuration objects

    Hi All,
    I am trying to "Generate the Configuration Objects" for Demo: CheckFlightAvailability.
    But in the GenerationLog I got the error under "Generation Statistic" saying that "Error when creating or changing configuration objects".
    I can any one tell me what went wrong?
    Regards,
    Nagarjuna.

    Did you ever solve this issue? We are experiencing the same errors, but with ZCM 11. Server configurstion is Windows Server 2008R2, database is MS SQL 2005.
    Every time we try to create or change a (Windows) bundle or policy there's an error message in ZCC. The error is:
    com.novell.zenworks.datamodel.exceptions.InternalD ataModelException: com.novell.zenworks.datamodel.exceptions.InternalD ataModelException: org.hibernate.exception.ConstraintViolationExcepti on: could not insert collection: [com.novell.zenworks.datamodel.objects.assignableco ntent.AssignableContentObject.ContentServers
    ...followed by a different GUID(?) every time.
    We've placed a SR but haven't had any suggestions from Novell yet - we're soon going from calm to panic as we are planning to move from test to production in two weeks...
    Cheers,
    Peter

  • Activity done when Excise duty changes in Budget

    Dear MM Experts,
    I am new with cin, so please tell me the step that includes when excise tax changed in Budget. what are the steps need to take when change in budget happen like duty & taxes??????/
    Regards
    Sumit

    As per budget changes MM point of view we can take following actions
    Budget changes
      The Excise Duty on all
         goods falling under Chapter 84 & 85 of the
         Schedule to the Central Excise Tariff Act is reduced from 12
         percent to 10 percent for the period upto 30.06.20 14.
         The rates can be reviewed at the time of regular Budget.
    So Relevant chapter Ids need to be maintained accordingly in FV11. preferably  country/Plant/Control code/ combination.
    you may received Excise invoices already with 12%. so please contact taxation team before changing
    Regards
    Maruthi S

  • Event handeling variable changes. Is this possible?

    Hey,
    I'm working on a java-beans project and I am trying to come to find a way to signal an event when a variable changes. Basically looking for a way to constantly send the refreshing data to the listener bean.
    I can easily get it to work send the data with pushing a button but this is supposed to monitor a constantly changing temperature and send it to the listener bean.
    Any ideas?
    Thanks.

    Use Timer or ur own Thread.

  • HT201412 My iPhone will not respond even once it is hooked to iTunes nor will it respond when I hit the power (reset) button. The screen mentions that the system is checking for "borrowed blocks" (small writing in the top right corner).

    My iPhone will not respond even once it is hooked to iTunes nor will it respond when I hit the power (reset) button. The screen mentions that the system is checking for "borrowed blocks" (small writing in the top right corner).

    Are you using the charger and cable that came with the phone?
    Are you using an unauthorized third party charger?

  • The pass 4 days now my iTunes Store is not responding, when I reload it all that comes up is a blank white page that says iTunes Store. Help please!!!! Cannot load my gift card to buy music and such!!!

    The pass 4 days now my iTunes Store is not responding, when I reload it all that comes up is a blank white page that says iTunes Store. Help please!!!! Cannot load my gift card to buy music and such!!!

    I tookyour suggestion and SUCCESS!  I can now access the Itunes Store.  A simple fix, and thanks so much!!.
    Below is the advice you forwarded:
    I found a solution to my problem.
    > start menu
    > accessories,
    > right click on the command prompt icon and choose "run as administrator".
    Once it opens, type in the following command...
    netsh winsock reset
    hit enter
    You should get a message that the winsock reset successful and you will need to reboot your computer.
    Reboot and when I reloaded itunes the store loaded fine.
    Thanks again, -Dean Stoneburner

  • Hi, I have quick question about use of USEBEAN tag in SP2. When I specify a scope of SESSION for the java bean, it does not keep the values that I set for variable in the bean persistent.Thanks,Sonny

     

    Make sure that your bean is implementing the serializable interface and that
    you are accessing the bean from the session with the same name.
    Bryan
    "Sandeep Suri" <[email protected]> wrote in message
    news:[email protected]..
    Hi, I have quick question about use of USEBEAN tag in SP2. When I
    specify a scope of SESSION for the java bean, it does not keep the
    values that I set for variable in the bean persistent.Thanks,Sonny
    Try our New Web Based Forum at http://softwareforum.sun.com
    Includes Access to our Product Knowledge Base!

  • Hello I have a problem with facebook Messenger disappeared from my desktop iPod in the AppStore it says "open" does not respond when I press it. What should I do to download it? But I do not have it in AppStore it says that I have it: (

    Hello I have a problem with facebook Messenger disappeared from my desktop iPod in the AppStore it says "open" does not respond when I press it. What should I do to download it? But I do not have it in AppStore it says that I have it: (

    - Go to Settings>General>Usage>Storage>and under apps select FBM and try to delete it.
    Next:
    - Reset the iOS device. Nothing will be lost      
    Reset iOS device: Hold down the On/Off button and the Home button at the same time for at
    least ten seconds, until the Apple logo appears.
    - Reset all settings                            
    Go to Settings > General > Reset and tap Reset All Settings.
    All your preferences and settings are reset. Information (such as contacts and calendars) and media (such as songs and videos) aren’t affected.
    - Restore from backup. See:                                               
    iOS: Back up and restore your iOS device with iCloud or iTunes
    - Restore to factory settings/new iOS device.                       

Maybe you are looking for

  • Help deploy flash builder 4.5 project

    I need help. I am trying to deploy my first Flash Builder 4.5 project using the Zend framework.  My application runs fine on my localhost (on my home computer).  I am having trouble deploying it to my remote server. The error I receive is 'Send faile

  • Patchdownloader: ERROR: DownloadContentFiles() failed with hr=0x800701f6

    Hi, SCCM 2012 R2 updates work fine. Only when I create an automatic deployment rule for Endpoint Protection definition updates, it has errors in the patchdownloader.log. I already used the upddwnlodcfg.exe /bypassproxy but that didn't work (should I

  • Creating a slideshow: need to fit still images in video track to audio

    Hello, I am creating a simple slideshow in FCP. I have 99 still images, all sequential, with a transition in my video track. I have two audio songs in sequence in my audio track. The obvious problem is that my audio is much shorter than my 99 images.

  • Changing your username... is it possible?

    is it possible to change your username for the apple discussions? i know it's not a big deal, but mine's boring... and lars isn't even my name haha

  • Sharing files in Macbook Pro

    Hi, If i want to send a Keynote presentation to my friend who uses windows, will she be able to view and edit it? and if she sends me a word document, will i be able to edit and view it in my MacbookPro? Thanks