NetBeans Forums
| View previous topic :: View next topic |
| Author |
Message |
mn1247
Joined: 04 Jan 2011 Posts: 64
|
Posted: Sat Mar 05, 2011 3:37 pm Post subject: How do properties get set for a JPanel? |
|
|
Suppose I have a JPanel subclass. In that subclass, I have defined a field myField with getters/setters.
If I add the panel to the Palette Manager, and then drag an instance into another panel, then myField appears in the "Properties" window and I can set it to a specific value.
When I run the application, myField has the correct value filled-in within the instance of the JPanel object (as seen in the debugger).
Okay, so good.
But, I have questions about this. How does NB insert the value? Evidently, this is done at runtime, but I don't known what the mechanism is. And, at what point in the creation of the JPanel instance does myField become valid? Should the value be available in the constructor? Or, after initComponents()?
Please help me understand how this works. Thanks.
Eric |
|
| Back to top |
|
 |
mn1247
Joined: 04 Jan 2011 Posts: 64
|
Posted: Sat Mar 05, 2011 11:34 pm Post subject: |
|
|
Still hoping for some help with this.
The main issue is that I want to access one of the properties from within the constructor of my class. All I get is "null" - it hasn't been set at that point.
So, when and how does it get set? And, can I somehow gain access to the property value from the constructor?
Thanks,
Eric |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
|