As Mark said, this is what the Bindable interface is for when deserializing BXML using BXMLSerializer. http://pivot.apache.org/tutorials/bxml-primer.htmlhttp://pivot.apache.org/2.0/docs/api/org/apache/pivot/beans/Bindable.html http://pivot.apache.org/2.0/docs/api/org/apache/pivot/beans/BXMLSerializer.html If you are not using BXMLSerializer, but perhaps building the Component graph manually, you would just need to keep references to any object which you wish to initialize, and then call that code at the appropriate point in your application's lifecycle. Chris
On 6 January 2012 09:16, Mark Dodgson <[email protected]> wrote: > Hi, > > I am very new to pivot/java (started yesterday) so might be totally wrong, > but I came accross the example on the pivot website which sounds like what > you are after. > > http://pivot.apache.org/tutorials/push-buttons.html > > Implementing bindable provides an initialize method that is called once on > startup > > Regards, > > Doddi > > > On 6 January 2012 07:59, V SANTOSH PAVAN RAJU BS <[email protected]> > wrote: >> >> Hi, >> Is there any listeners that can be used to execute some block of code at >> initialization time. >> For example, buttonPressListeners execute a block of code when that >> corresponding button was clicked. >> But, i want to execute a block of code that should run at initialization >> time only, without any event occurs. >> >> I wrote some code to do this. >> >> this.getComponentClassListeners().add(new ComponentClassListener() { >> @Override >> public void focusedComponentChanged(Component component) { >> custIdTest = WindowContext.getCustomerId(AccountInformationPane.this); >> System.out.println(custIdTest); >> } >> }); >> >> Here i tried to get a value from other class which is WindowContext in to >> AccountInformationPane class which extends BoxPane. >> System.out.println(custIdTest); this statement was executed >> infinitely...... >> >> So is there any other way to do this? >> -- >> Thanks & Regards >> B.S.V.S.Pavan Raju. >> Skype: skype_pavan1 >> Hyderabad. >> >
