Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

Can I edit the blue, guarded blocks of code when developing a GUI?

0
Posted

Can I edit the blue, guarded blocks of code when developing a GUI?

0

Yes, you can do it by editing special “code” properties. Selected a component, go to the Properties window and select the Code tab. You can completely replace the way components are instantiated (Custom Creation Code), add code before or after creation and properties initialization. The only difference is that this code is stored in the XML .form file, so it is included when the guarded code is regenerated. However, please note that you can easily write your code out of the guarded block, typically into the constructor after the initComponents() method call, as additional setup code that should be performed. This option is often forgotten, but it is the most eficient and easiset way to add custom code, working in most situation (e.g. except custom instantiation code). If you’re writing a fairly simple bean, you may not want to use the GUI editor for that. But, if you have a burning desire to edit the contents of guarded blocks (again, do try the Code options — you have complete control

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123