2009/8/19 zhaoyi <[email protected]> > > Below is my code. The class AnnotationDemo3 has a panel field which > will be injected by annotation. The output of this program is: > > null > demo.bindinganontation.MyPanel[, > > 0,0,0x0,invalid,layout=java.awt.FlowLayout,alignmentX=0.0,alignmentY=0.0,border=,flags=9,maximumSize=,minimumSize=,preferredSize=] > > In the constructor, the printf will print a null value which means the > panel field doesn't have been created at this time. How can I let it > creates the field at the very beginning time of the create created. >
I don't see any code here, but it sounds like you need to use constructor injection: http://code.google.com/p/google-guice/wiki/Injections thanks. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "google-guice" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/google-guice?hl=en -~----------~----~----~----~------~----~------~--~---
