Problem referencing a newly created class instance - I don't understand why

Hi,
I am completely new to actionscript although I do come from a OOP background. I have been asked to trial Flash and Actionscript 3 in particular - so I do come with a few preconceptions on how I expect actionscript to behave.
I have a problem I donot understand. I have created a new class and to test it I use a simple test harness in the form of a .fla file.
The issue I have is when I create a new instance of the class and assign it to a variable, subsequent background changes to that instance of the class are not 'picked-up' when referenced through the variable. I would expect that given instance of class could be assigned to many different variables and any updates using one variable would  accessible using any of the other variables.
My test class, XMLDataLoader, is coded as follows:
package  {   
    public class XMLDataLoader {
        import flash.events.*;
        import flash.net.*;
        import flash.utils.*
        private var _xmlData:XML;
        private var _xmlLoaded:Boolean;
        public function XMLDataLoader(pFileName:String){
            init(pFileName);
        public function getXMLData():XML {
            return this._xmlData;
        public function XMLLoaded():Boolean {
            return this._xmlLoaded;
        private function init(pFileName:String):void
            // Create the URLLoader instance to be able to load data
              var loader:URLLoader = new URLLoader( );
            var urlRequest:URLRequest = new URLRequest(pFileName);
            this._xmlLoaded = false;
            // Define the event handlers to listen for success and failure
               loader.addEventListener ( Event.COMPLETE, handleComplete );
            loader.load(urlRequest);
            function handleComplete ( e:Event ):void
                trace ( "The data has successfully loaded" );
                this.xmlData = new XML(e.currentTarget.data);
                this._xmlLoaded = true;
The class simply reads a text file and assigns its contents to the class variable _xmlData. The class variable _xmlLoaded identifies when the load is complete.
The test harness is a simple flash app consisting if a single timeline with 1 frame, 1 symbol on the stage and the following actionscript code:
import flash.events.TimerEvent;
var t:XMLDataLoader = new XMLDataLoader("Test Article.xml");
var xmlData:XML;
var waits:uint = 0;
wait(1);
function wait(ct:uint):void
    var TimerInstance:Timer = new Timer(500, 1);
    TimerInstance.addEventListener(TimerEvent.TIMER, TimerHandler);
    TimerInstance.start();
    function TimerHandler(event:TimerEvent):void
       if(t.XMLLoaded()){
            xmlData = t.getXMLData();  
            trace(xmlData.toXMLString);
        } else {
            trace(ct + " - Waiting....");
            if (ct <= 10) {
                wait(++ct);
The script defines a variable and assigns it a new instance of the XMLDataLoader. Originally, I immediately followed this with a trace statement but  insuffient time had elapsed to allow the load to complete, so I had to introduce a wait function to force a delay. This wait function is recursive. It checks to see if the load is complete. If it is, a trace statement will outoput the xml. If not the function will call itself again (upto 10 times)
The resultant output is as follows:
The data has successfully loaded
1 - Waiting....
2 - Waiting....
3 - Waiting....
4 - Waiting....
5 - Waiting....
6 - Waiting....
7 - Waiting....
8 - Waiting....
9 - Waiting....
10 - Waiting....
According to this output, the XML has been loaded before the end of the first timer cycle but this is not detected in the test harness. I have stepped through the code in debug mode and I have confirmed that the XML was loaded, and the class variables where correctly set, including _xmlLoaded = true. However, in the test harness the instance both class variables  are null. I don't believe this should be the case but obviously I must be wrong - can anyone explain where my logic is flawed. I did think scoping might be the problem but having tried a couple of modifications, I concluded that it wasn't.
Thanks in advance.

never nest named functions.  unnest TimerHandler and retest.
(and, you should be using listener to determine when loading is complete.)

Similar Messages

  • I try to create my Account ID....and i don't understand why i have to put payment? before my friend create Account ID don't have to put payment they still can create account ID... and now i buy iphone but i don't have credit card that mind i can't not do

    Dear
    I try to create my Account ID....and i don't understand why i have to put payment? before my friend create Account ID don't have to put payment they still can create account ID... and now i buy iphone but i don't have credit card that mind i can't not do it

    Hi,
    This Link explains how to Set Up an Account ID...  without a credit card...
    http://support.apple.com/kb/HT2534
    Hope it helps,
    Cheers,

  • I bought ifiles app. But I paid a lot of time prize. I don't understand why... Please solve problem!

    I bought ifiles app. But I paid a lot of time prize. I don't understand why... Please solve problem!

    tuydun wrote:
    .. Please solve problem!
    To Contact iTunes Customer Service and request assistance
    Use this Link  >  Apple  Support  iTunes Store  Contact

  • Creating Class Instances from Strings

    Folks,
    I have a class called Employee. I would like to create instances of this class based on the user input in certain JTextFields in a form. For instance, if the user inputs First Name = John and Last Name = Doe, then the instance John_Doe of the Employee Class is created. I played w/ newInstance() and Class.forName() but can't seem to get that working. Does this require reflection? I just need someone to point me in the right direction.
    Thanks,
    steve

    Dear jverd (and walken),
    Thanks for your note. I'm sorry, I don't really
    understand what you mean by "is the class determined
    at runtime or just the parameters?"It sounds like walker answered your immediate questions, but just to clear up this (which I guess I didn't state very clearly), what I meant was, will you sometimes be creating an Employee, and sometimes some other class, or will it only be the employee's name, etc., that's different for each one you create?
    If, at the time you're writing your code, you know which class you're creating, then you don't need reflection. You just do new WhateverTheClassIs() (possibly passing parameters, such as names, to the constructor.
    On the other hand, if the class to be instantiated will be determined at runtime--maybe you prompt the user for which class, and he enters "Employee"--then you need to use reflection.
    You shouldn't need to worry about reflection for a while. Get the fundamentals of the language solidly under your belt before you tackle that. Good luck! :-)

  • Creating class instances at different depths

    I have a custom class called line that takes two sets of co
    ordinates and draws a line between them.
    The class uses _root.createEmptyMovieClip() to make a
    container to draw in to but I need it to draw in to other movies on
    the stage in a similar way to createEmptyMovieClip() eg
    _root.childClip1.childClip2.line=new Line(x1,y1,x2,y2);
    I have tried createEmptyMovieClip(),
    this.createEmptyMovieClip(), _parent.createEmptyMovieClip() etc but
    with no joy.
    How can my Line constructor function get the path information
    from the declaration or do I have to pass it as a parameter?

    Whenever I design a class, that class always takes a
    target:MovieClip parameter. then I create a container for the class
    inside that target. This way, I can place my class objects inside
    any clip I so desire at any level.

  • Approval Flow problem for the newly created user

    Dear friends.
    We have a new user .
    The approval flow is not starting for her shopping carts.
    I have checked YAM to see the cost centre but it is correct.
    What could be the problem and how do i check the workflow.
    I am not much into the technical side of SRM.

    Hi,
    You can use Tx BBP_PD with Shopping cart number, Alo you can view the workflow logs in swi1 or swi2_freq. Then you can check starting conditions
    BR
    Reward if helpful

  • Problem accessing a newly created service

    Hello
    i've create a new service to gather statistic for several componants. This service has been deployed, and
    seems to be started (as shown by the system admin/ support / Portal runtime / Application console).
    the deployment file is the following :
    <?xml version="1.0" encoding="UTF-8"?>
    <application>
      <application-config/>
      <components/>
      <services>
        <service name="StatisticService" alias ="Statistics">
          <service-config>
            <property
                 name="className"            
                 value="com.xxx.service.StatisticService"/>
            <property name="startup" value="true"/>
          </service-config>
        </service>
      </services>
    </application>
    However, i'm not able to access  the service from another componant (DynPage). The deployement file for
    this componant possess a refernce to the service, but this does not work. Running the dynpage, I get a message
    with a log Id (which state that the application can not be found).
      <application-config>
        <property name="PrivateSharingReference" value="com.sap.portal.htmlb, Titan"/>
        <property name="ServicesReference" value="com.sap.portal.ivs.iviewservice, com.xxx.service.StatisticService"/>
        <property name="releasable" value="true"/>
        <property name="testable" value="true"/>
        <property name="SharedAccess" value="shared"/>
      </application-config>
    The same result occurs if i use the projet.servicename or servicealias as reference
    if i does not reference the service in the file, i can run the dynpage, but there is an exception when i try to get the service.
    IStatisticService cgService =
    (IStatisticService)PortalRuntime
       .getRuntimeResources()
       .getService(
          IStatisticService.KEY);
    does anyone have an idea on how i can access the service ?
    regards
    Guillaume

    Hello,
    try with following code:-
    //for service
    <?xml version="1.0" encoding="utf-8"?>
    <application>
      <application-config/>
      <components/>
      <services>
        <service name="PercentCalc" alias="PercentCalc">
          <service-config>
            <property name="className" value="com.sap.training.PercentCalc"/>
            <property name="startup" value="true"/>
          </service-config>
          <service-profile>
            <property name="filename" value="test"/>
          </service-profile>
        </service>
      </services>
    </application>
    //for testing service
    <?xml version="1.0" encoding="utf-8"?>
    <application>
      <application-config>
        <property name="SharingReference" value="06-CustomPortalService"/>
        <property name="SecurityArea" value="portal"/>
        <property name="Vendor" value="com.customer"/>
      </application-config>
      <components>
        <component name="TestService">
          <component-config>
            <property name="ClassName" value="com.sap.training.TestService"/>
            <property name="SafetyLevel" value="low_safety"/>
          </component-config>
          <component-profile/>
        </component>
      </components>
      <services/>
    </application>
    This was tested and it runs without any errors.
    Regards,
    Yogesh...

  • I don't understand why so many of us are having the same problem...

    i came on here to post that itunes doesn't recognize my ipod, that it freezes up itunes when i plug it in (even though it doesnt recognize it), that it just stays in 'do not disconnect' mode even when i try to safely remove it, and the only way to disconnect is to turn off the computer or reset a couple of times.
    i saw that there are a ton of people on here with the same problem, it seems pretty ridiculous, there is obviously a major problem with the software that so many people are having identical problems.
    i tried everything everyone suggested on here- reset, restore (like someone else below, it just freezes the ipod updater program & cannot update OR restore), i did the holding select & previous to get that weird menu but couldn't find the "I/O" selection that was recommended to check the USB port, tried putting it in disk mode to update/restore but still no dice...
    does anyone have any SUCCESS stories about getting their ipod fixed with these problems? it is my husband's ipod that is all screwed up & now I'm afraid to plug mine into the computer b/c his hasn't worked correctly since this started- it stops mid song or after playing just one song in a playlist, is making a lot of clicking noises, etc.
    i guess the apple store is the only way to go or sending it back????
    Thanks!!!!

    Buegie:
    I think you've missed the point of the original poster's post. There are many people here who have the same issue, and have explained themselves rather well. It would be one thing if the issue involved different error messages (and god forbid Apple provided meaninful messages for anything) or different physical problems or different attempts to solve the problem. I've read a number of these posts, many made within the past week, the majority since about mid-December, and all of them appear to be relatively similar.
    Indeed, I am having the same issue, and have been since (as far as I can tell) late-December. My iPod works perfectly normally when not connected to my PC, but as soon as I connect it, iTunes, the iPod software, and even Windows itself will not recognize it as an iPod. The device appears to start normally, then reaches the "Do not disconnect" screen and remains there, causing whichever programs are currently attempting to mount the drive to hang (this includes Explorer and the iPod software). I am unable to stop these programs or unmount the iPod until either a) a timeout is reached or b) I manually disconnect it. I have come here as a last resort before calling Apple, as I have already read many of the support articles and attempted the fixes they provided, with no success. I have read through many posts on this board regarding similar issues, and none of the fixes provided by you or anyone else have been effective.
    In short, while your posts may help those who have never diagnosed computer or device problems in the past, or who have not read through Apple's online help area, they are not the absolute answer to everyone's problem, and they are not specific enough to be of any assistance to those who have already narrowed the problem down. In this post in particular, you do little more than assault the original poster for suggesting that perhaps there is some other explanation for the plight of these users. One may be led to believe that you work for Apple and are attempting to cover up a known bug in the software or hardware so as to avoid the mass replacement of devices. While this conclusion is not altogether likely, your attitude and actions do not lead one to believe otherwise.
    There could be any number of similarities to bring to light, and posts like yours prevent people from doing so. Perhaps it has something to do with the current version of iTunes, the iPod update software, the iPod service, a patch for Windows, or even dirt in the iPod's data port.
    For those of you who are also experiencing the same problems the original poster and I are having, if you have already tried any or all of the following with no success, please reply to this post:
    1. Restarting iPod (either connected or not connected to PC)
    2. Ensuring that the iPod is fully charged
    3. Restarting PC
    4. Reinstalling iTunes and/or iPod software
    5. Attempting to mount iPod in "Disk Mode"
    6. Attempting to mount iPod with iPod service stopped
    7. Running diagnostic tests on iPod (on restart, hold Select+Previous to reach diagnostic menu), all of which pass
    8. Changing between Firewire and USB cables
    9. Changing between Firewire and USB ports which are known to work properly
    Thank you.
    home built, foo   Windows XP Pro  

  • Guys, the playlists I created on iTunes do not show up in the Sync options for the iPod. I don't understand why not.

    It only shows me the Generic Playlists but not mine.
    Please help, Thank you.

    I'm not sure what you mean when you say that the wireless devices are not  visible in AirPort Utility.
    Open AirPort Utility - Click Manual Setup
    Click on Wireless Clients (3rd line from the bottom) and a window will open to display the AirPort ID of each connected device.
    I'm also not sure what you mean by "manage". Once a wireless device is connected to the network, you cannot "disconnect" it from the network using AirPort Utility. AirPort Utility only monitors the connection.
    Using the Timed Access feature in AirPort Utility, it is possible to assign daily time limits for each device that is allowed to connect to the wireless network.
    So, for example, one iPod would be allowed daily access from 8AM to 11 PM. The iPod would not be allowed to connect between 11:01 PM and 7:59 AM in this example.
    You can set up different time limits for each device that you want to allow to connect to the wireless network in similar fashion.

  • HT201364 I currently have System 10.8.5, Mt Lion and my processor is 3.6 GHz Intel Core i5 with Memory:12 GB 1333 MHz DDR3. I don't understand why there is a problem?

    I need to know if I can erase or delete the corrupt down load and restart the download procedure again?

    Yes, you can delete the corrupt download.
    You can try a couple of things to help the download:
    Restart modem and router.
    Boot into Safe Mode and download while in Safe Mode.
    http://support.apple.com/kb/HT1564

  • Problem with Beansbinding as separated class

    Hello,
    I used beansbinding together with a JTextfield and usually it works, which means that if I do it like the following;
      /// the class that I use implements a binding listener
    binding = Bindings.createAutoBinding(AutoBinding.UpdateStrategy.READ_WRITE,                        // two-way binding
                                                        systemDaten ,                                                             //source and backing bean
                                                           BeanProperty.create("debeyeHueckelkonstanteA") ,          //name of field
                                                           debeyeHueckelkonstanteA,                                            // name of jtextfield as swing source
                                                           textProperty,                                                     //Property textProperty = BeanProperty.create("text");  
                                                          "debeyeHueckelkonstanteA" );                             // Name      
              binding.setConverter(null);
           binding.setValidator(null);
               binding.addBindingListener(this);                                                  /// this = because the class that I use implements a binding listener
            binding.bind();
    //if I use instead of binding.addBindingListener(this) the following version with an anonym class, it works as well:
    binding.addBindingListener(new BindingListener() {
                @Override
                public void bindingBecameBound(Binding binding) {
                @Override
                public void bindingBecameUnbound(Binding binding) {
                @Override
                public void syncFailed(Binding binding, SyncFailure failure) {
                @Override
                public void synced(Binding binding) {
                @Override
                public void sourceChanged(Binding binding, PropertyStateEvent event) {
                @Override
                public void targetChanged(Binding binding, PropertyStateEvent event) {
            } );if I use this form using a customized class and a constructor with the data (double number) to be represented :
                            binding.addBindingListener(new SystemBindingListener(systemDaten.getMesstemperatur()) )with a class implementing the listener as below it doesn't work.
    public class SystemBindingListener implements BindingListener {
        private double value = 0.0;
        public SystemBindingListener(double value) {
         super();
         this.setValue(value);
        private final PropertyChangeSupport propertyChangeSupport =
         new PropertyChangeSupport(this);
         public void addPropertyChangeListener(PropertyChangeListener l) {
         propertyChangeSupport.addPropertyChangeListener(l);
        public void removePropertyChangeListener(PropertyChangeListener l) {
         propertyChangeSupport.removePropertyChangeListener(l);
                 @Override
                    public void bindingBecameBound(Binding binding) {
                        System.out.println("bound ok " + binding.getName());  }
                @Override
                    public void bindingBecameUnbound(Binding binding) {
                        System.out.println("unbound ok " + binding.getName());  }
                @Override
                    public void syncFailed(Binding binding, SyncFailure failure) {
                        System.out.println("sync not ok " + binding.getName());  }
                @Override
                    public void synced(Binding binding) {
                    this.setValue(value);
                      System.out.println("sync ok " + binding.getName() + this.getValue()); }
                @Override
                    public void sourceChanged(Binding binding, PropertyStateEvent event) {
                        System.out.println("source ok " + binding.getName());    }
                @Override
                    public void targetChanged(Binding binding, PropertyStateEvent event) {
                        System.out.println("target ok " + binding.getName()); }
            public double getValue(){
             return value;
            public void setValue(double value){
            final double old = this.value;
         this.value = value;
         propertyChangeSupport.firePropertyChange(
                          "value", // the name of the property
                          old, // the old value
                          value // the new value
            this.value = value;
    }The problem is that I wanted to "outsource" the BindingListener but change its output depending on the source modified on the GUI.
    I have several textfields and I want to be sure that whenever one of them gets modified the value is modified in the backing bean
    and this should be visible by the System.out.println(this.getValue()) output.
    I added Property Support but this didn't help. As you can see I want a Read-Write Binding which works as described in the first two examples.
    But with a externalized class binding doesn't work.
    Does anyone know how to do this.
    Thanks for help
    Thommy
    Edited by: 886674 on 4 oct. 2011 08:31
    Edited by: 886674 on 4 oct. 2011 08:35

    Hello,
    I am not sure if it is as short as you want to, but anyway there cannot be less classes than that, because I need each of them and any further reduction
    would falsify the situation given.
    Also there are only some lines which are determining size, location - and especially Layout - etc which I left nearly as they are.
    Before using the given function addComponent() I had big problems to get a proper GUI Layout so I changed not to much concerning the layout (I didn't want to take the risk that nothing appears at all (or not at the right place) as I experienced many times before).
    Anyway, it is much less than the 10 classes (or the 30 original classes) I had before. So here is the code:
    package controls;
    import java.awt.BorderLayout;
    import java.awt.Component;
    import java.awt.Dimension;
    import java.awt.FlowLayout;
    import java.awt.GridBagConstraints;
    import java.awt.GridBagLayout;
    import java.awt.GridLayout;
    import java.awt.Toolkit;
    import java.beans.PropertyChangeListener;
    import java.beans.PropertyChangeSupport;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import javax.swing.JPanel;
    import javax.swing.JTextField;
    import org.jdesktop.beansbinding.AutoBinding;
    import org.jdesktop.beansbinding.BeanProperty;
    import org.jdesktop.beansbinding.Binding;
    import org.jdesktop.beansbinding.Binding.SyncFailure;
    import org.jdesktop.beansbinding.BindingGroup;
    import org.jdesktop.beansbinding.BindingListener;
    import org.jdesktop.beansbinding.Bindings;
    import org.jdesktop.beansbinding.Property;
    import org.jdesktop.beansbinding.PropertyStateEvent;
    public class Main {
        public static Mainframe wg = null;
        public static void main(String[] args)  {
        wg = new Mainframe();
        wg.setVisible(true);
    class Mainframe extends JFrame {
    public static final long serialVersionUID = 1111111;
        private JPanel pnlOben;
        private JPanel pnlMitte;
        private KonstantenPanel kp = null;
        private   Dimension screendimension;
        private   Dimension dimension;   
        public Mainframe(){
        super();
        this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        screendimension = Toolkit.getDefaultToolkit().getScreenSize();
        dimension = new Dimension();
        dimension.setSize(400, 400);
        this.setSize(dimension);
        this.setLocation((int) ((screendimension.getSize().getWidth()) / 2), (int) (screendimension.getSize().getHeight()/ 2));
        init();
    public void init(){
      desktopMalen();
    private void desktopMalen() {
             this.setLayout(new BorderLayout(20, 20));
            this.add(NordPanelMalen(), BorderLayout.NORTH);
            this.add(CenterPanelMalen(), BorderLayout.WEST);
            this.add( new JPanel(),BorderLayout.SOUTH);
        private JPanel NordPanelMalen() {
            pnlOben = new JPanel(new FlowLayout(FlowLayout.LEFT));
            pnlOben.add(new JLabel("Test"));
           return pnlOben ;
       private JPanel CenterPanelMalen() {
            this.pnlMitte = new JPanel();  //new FlowLayout(FlowLayout.CENTER
            this.pnlMitte.setLayout(new GridLayout(1, 1));    
            Dimension d = new Dimension();       
            this.pnlMitte.setSize(400,400); d.setSize(400, 400);
            KonstantenPanel bp = new KonstantenPanel(d);  //// the panel with the swing component
             this.pnlMitte.add(bp);
      return pnlMitte;
    class KonstantenPanel extends JPanel {
        public static final long serialVersionUID = 1111111;  
        private Systemdaten systemDaten = null;
        private JTextField messtemperatur;
        private BindingGroup bindinggroup = null;
        private Binding binding;
        private SystemBindingListener sbl1;
        public KonstantenPanel(Dimension d) {
        this.setSize(d);
        init();
        private void init() {
       systemDaten = new Systemdaten();           /////// the bean class
        GridBagLayout gbl = new GridBagLayout();
       this.setLayout(gbl);
        this.addComp(gbl,new JLabel("Konstanten"),0,0,4,1,0,0,GridBagConstraints.HORIZONTAL, GridBagConstraints.NORTHWEST);
        this.addComp(gbl,new JLabel("                   "),     0,1,4,1,0,0,GridBagConstraints.HORIZONTAL, GridBagConstraints.NORTHWEST);
        this.addComp(gbl,new JLabel("Messtemperatur   "),       0,2,2,1,0,0,GridBagConstraints.HORIZONTAL, GridBagConstraints.NORTHWEST);
                                                                /////the swing component using beansbinding
       messtemperatur = new JTextField("298.15             ");
       messtemperatur.setName("messtemperatur");
       this.addComp(gbl,messtemperatur ,  0,3,2,1,0,0,GridBagConstraints.HORIZONTAL, GridBagConstraints.NORTHWEST);
                                                         ///all the binding is done here in:
       bindProperties();
        @SuppressWarnings("unchecked")
            private void bindProperties() {
         Property textProperty = BeanProperty.create("text");
            bindinggroup=new BindingGroup();
         binding = Bindings.createAutoBinding(
           AutoBinding.UpdateStrategy.READ_WRITE, // two-way binding
           systemDaten,                 // bean
           BeanProperty.create("messtemperatur"),
           messtemperatur,        //field
           textProperty,        //name of property
           "messtemperatur" //name
            sbl1 = new SystemBindingListener(systemDaten.getMesstemperatur());
            binding.addBindingListener(sbl1);
            binding.setConverter(null);
         binding.setValidator(null);
             binding.bind();
             bindinggroup.addBinding(binding);
        bindinggroup.bind();
         public void addComp (   //Container cont,
                             GridBagLayout gbl, Component c, int x, int y, int width, int height, double weightx, double weighty, int cbc, int a)
        GridBagConstraints gbc = new GridBagConstraints();
        gbc.fill = cbc ; //GridBagConstraints.BOTH;
        gbc.gridx = x; gbc.gridy = y;
        gbc.gridwidth = width; gbc.gridheight = height;
        gbc.weightx = weightx; gbc.weighty= weighty;
        gbc.anchor = a; gbl.setConstraints(c, gbc);
        this.add(c);
         * in praxis the extra class would be especially interesting if there are more variables     *
    class SystemBindingListener implements BindingListener {
        private double value = 0.0;
        SystemBindingListener(double value) {
         super();
         this.setValue(value);
        private final PropertyChangeSupport propertyChangeSupport =     new PropertyChangeSupport(this);
        void addPropertyChangeListener(PropertyChangeListener l) {
         propertyChangeSupport.addPropertyChangeListener(l);
        void removePropertyChangeListener(PropertyChangeListener l) {
         propertyChangeSupport.removePropertyChangeListener(l);
                 @Override
                    public void bindingBecameBound(Binding binding) {
                        System.out.println("bound ok " + binding.getName());  }
                @Override
                    public void bindingBecameUnbound(Binding binding) {
                        System.out.println("unbound ok " + binding.getName());  }
                @Override
                    public void syncFailed(Binding binding, SyncFailure failure) {
                        System.out.println("sync not ok " + binding.getName());  }
                @Override
                    public void synced(Binding binding) {
                    this.setValue(value);
                      System.out.println("sync ok " + binding.getName() + this.getValue()); }
                @Override
                    public void sourceChanged(Binding binding, PropertyStateEvent event) {
                        System.out.println("source ok " + binding.getName());    }
                @Override
                    public void targetChanged(Binding binding, PropertyStateEvent event) {
                        System.out.println("target ok " + binding.getName()); }
            double getValue(){
             return value;
           void setValue(double value){
            final double old = this.value;
         this.value = value;
         propertyChangeSupport.firePropertyChange(
                          "value", // the name of the property
                          old, // the old value
                          value // the new value
            this.value = value;
    class Systemdaten {
    static final long serialVersionUID = 1111111L;
        private double messtemperatur = 298.15;
        private final PropertyChangeSupport propertyChangeSupport =     new PropertyChangeSupport(this);
       void addPropertyChangeListener(PropertyChangeListener l) {
         propertyChangeSupport.addPropertyChangeListener(l);
       void removePropertyChangeListener(PropertyChangeListener l) {
         propertyChangeSupport.removePropertyChangeListener(l);
      double getMesstemperatur() {
            return messtemperatur;
       void setMesstemperatur(double messtemperatur) {
            final double old = this.messtemperatur;
         this.messtemperatur = messtemperatur;
         propertyChangeSupport.firePropertyChange(
                          "messtemperatur", // the name of the property
                          old, // the old value
                          messtemperatur // the new value
            this.messtemperatur = messtemperatur;
    }Due to your questions I guess to know why it there is no binding between the Listener-Instance and the Swing-Compound but
    I don't see how to get all three classes working together.
    I mean: If I want to have a binding between the value variable in the BindingListener and the SwingCompound I need to create such a binding in the panel-Class.
    But I only created a binding with the field in systemDaten because this is the bean I want to work with.
    It seems that I didn't understand how it is managed that the value is changing in the bean and the swingcompound simultaneously - after creating and adding the
    BindingListener-Instance.
    In the two other cases there is still a communication between the Listener and the swingCompound but in the given case there is not.
    I was not aware of this problem before and I am still not sure to fully understand why it works in the other cases.
    Do I need to give the binding variable or swing compound to the BindingListener to keep communication ?
    Thanks for your help
    Thommy

  • How to deploy and run application in user created OC4J instance

    Hello friends,
    I have created my own OC4J instance in Application Server Control.Now,how can I deploy and run application in this newly created OC4J instance.I need your help,it's
    urgent.
    Regards
    Prasenjit

    Hi Andreas,
    Thanx for your prompt reply.Yes,I had deployed the '.ear'in that.But I am not able to run the program in
    browser.Could you please elaborate more precisely.I wouuld be obliged.
    Regards
    Prasenjit

  • Why is it necessary to create an instance via the static method?

    Hi,
    For some classes (such as java.util.regex.Pattern), we should call the class method (static method) in order to create an instance (object).
    For example, in order to conduct the pattern matching, we should use the java.util.regex.Pattern class as follows:
    Pattern p = Pattern.compile ("X[0-9]+X") ;
      // An instance of the Pattern class is created.
    Matcher m = p.matcher ("abcX1XYX23Xz") ;
    while ( m.find() ){
      System.out.println ( m.start() ) ;
    }where the compile static method in the Pattern class creates an instance and returns the pointer (reference) of it. We should NOT call
    the constructor of the Pattern class as follows:
    Pattern p = new Pattern ("X[0-9]+X") ;    // ERRORThe question is the following:
    (1) In what scenes, do we develop the classes that force users to call the static method for creating an instance of it?
    (2) Why do the java.util.regex.Pattern class have such a specification?
    Thanks in advance.

    (1) In what scenes, do we develop the classes that force users to call the static method for creating an instance of it?1. As the other author mentioned, caching is one reason.
    2. With such caching, you don't need to take trouble in passing the reference of a cached object(s) to many places in your code. From anywhere in your code base, you can simply invoke the method, the object will come. In essence, the static method provides a global point of access to one or more pre-created (or cached) objects. Hence, the static method simplifies access to the object.
    3. Sometimes, the actual class instantiated is not the same as the one with the static method. This allows abstraction of underlying variations. For example, when you say Pattern.compile ("X[0-9]+X") , the returned object type can be different in Windows and Linux (Most probably Pattern class doesn't work like that, but I am showing you a use case. May be Runtime.getRuntime() does actually work like that.). You find this abstraction of variations in many places. Take for example, FacesContext.getExternalContext() method (this is from JSF API). ExternalContext documentation says this:
    "This class allows the Faces API to be unaware of the nature of its containing application environment. In particular, this class allows JavaServer Faces based appications to run in either a Servlet or a Portlet environment."
    Edited by: Kamal Wickramanayake on Oct 24, 2012 8:04 AM

  • Manage Views - newly created view won't display

    Hi All,
    I was recently asked to create a portfolio view for a new senior project manager. I've done this before so I thought it would be fine. However, once I create the view and I go back in to the Poject Centre, the view won't display. It just shows
    a grey page. I then deleted the view I created and duplicated an existing view (but just changed the filter so it showed the projects managed by the senior's directs) but even that won't display.
    I don't understand why this has worked every time previously and not now. Any idea what it could be?
    Thanks in advance for any help/advice.
    Clair.

    Hi Clair,
    What does exactly happen? Can you see the view name in the view drop down menu?
    In case you don't, there are 2 main things to validate:
    Which type of view did you select? In order to be accessible from the project center, it has to be a project center view and not for example a project view. See screenshot below (unfortunately in french).
    Did you correctly associated the appropriate security category with the view? Indeed, if project manager are in the default project manager security group that is associated to the "my projects" category, you need to associate the newly created
    view with the "my projects" category.
    In case you see the view in the dropdown list but when selecting it, nothing is diplayed, check for filters in the project center page or directly in the view configuration. Check also if the account you're connecting with has proper rights to access the
    list of projects displayed by the view.
    Hope this helps.
    Guillaume Rouyre - MBA, MCP, MCTS

  • Cant use existing apple id or create new one on a new ipod, why ?

    Hello, my friend has been using my Apple ID but now he bought a new iPod and he wants to have his own Apple ID but also transfert everything from his old one to the new one. However, when trying to set up the new iPod, it won't take my Apple ID or create a new one and i don't understand why. I think to transfer the datas, i have to restore using his old one's name and that's it ?.But when he puts iTunes on his own computer, is everything gonna be transferred from his iPod to iTunes ?

    - Apps are locked to the account that purchased them and can't be transferred between acounts
    - To update apps you have to sign into the account that purchased the apps. If you have apps that need updating purchased from more than one account you have to update them one at a time until the remaining apps were purchased from one account.
    iOS: Transferring information from your current iPhone, iPad, or iPod touch to a new device

Maybe you are looking for

  • How can I recover my data from my hard drive

    About 2 weeks ago I was uploading pictures to my computer when it froze. I turned it off by holding down the power key, and started it up again. It hasn't gone past the apple screen and the spinning dial since. I have tried all the troubleshooting my

  • ITunes Store loop

    Honestly, I don't know what's going on right now. I tried making an in-app purchase and its telling me to verify my payment information. I verified by putting in my security code since that was the only thing blank to fill in. But when I filled it in

  • Internal system error

    When i am running my program, Its is sometimes throwning the following error. Internal program error; (SAPLEHSB 1 EHSB_BSCP_BUF_INIT buffer-init-error) What is this error? Under what circumstances it arises?

  • Why won't FCPX import .mts files?

    I love shooting 1920x1080/50p, but FCPX will not recognise the files. Both Panasonic and Sony use this framerate now butto get work into FCPX I have to shoot at 50i. I know I can convert using clipwire and the like, but why should I have to go to tha

  • Suspend

    My MacBook Air crashes on wake up after it has been put to suspend by closing the lid.  This has only started happening after loading Mountain Lion. Any ideas why?