If you are using GUI Builder, the code inside of the method initComponents()
should not be messed with. It only deals with initializing the components and laying out the components. If you try messing with the layout, you might break the whole thing. Since everything is initialized in the initComponents
, just add you code below it.
public class FrameForm extends JFrame {
public FrameForm() {
initComponents();
Your Code Here!
}
}
If you really need to add code inside the initComponents
though, just right click on a component form the design view and select Customize Code from the context menu.