This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes How can I make the field initialized before the initComponents method is called? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "How can I make the field initialized before the initComponents method is called?" Watch "How can I make the field initialized before the initComponents method is called?" New topic
Author

How can I make the field initialized before the initComponents method is called?

Jacky Luk
Ranch Hand

Joined: Aug 02, 2012
Posts: 601
My application is undergoing a major overhaul after the demo
The lblCustomerID is null when being added to the GradientPanel which is a JPanel with Database and
decoration support.
Thanks
Jack
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39478
    
  28
Why have you got so many fields?
Put the initialisation in the constructor.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: How can I make the field initialized before the initComponents method is called?