- Select the desired component.
- In the Inspector, check the option Custom Create.
- With the component selected, press F4F4, or choose Jump to Source on the context menu.
- In the text editor, locate the method createUIComponents(), and type the desired source code. The code in this method will not be removed on compilation.
Example
For example, you would like to provide non-default constructors for the radio buttons 1 and 2, and have GUI Designer create a default constructor for the radio button 3:
... //For the radio buttons 1 and 2, option Custom Create is set to true. //You write custom constructors for these components //in the method createUIComponents() private JRadioButton radioButton1; private JRadioButton radioButton2; //For the radio button 3 the default constructor is generated automatically //in the method $$$setupUI$$$(). The component properties //specified in the GUI Designer //are generated as calls to the set* methods in $$$setupUI$$$(). private JRadioButton radioButton3; ... private void createUIComponents() { radioButton1 = new JRadioButton("Custom text 1"); radioButton2 = new JRadioButton("Custom text 2"); } ... private void $$$setupUI$$$() { createUIComponents(); ... radioButton3 = new JRadioButton(); radioButton3.setText("RadioButton"); ... }

