I have been working on a purely hand coded interface that encapsulates a form. Everything works fine except until I add a button to a container. The button does use the resource I created using the BorderWizard. I couldn't see anything in the discussion groups about this or see any material difference from the KitchSink demo.
Adding the button does not break functionality and everything works as expected. Should I create the form on a background thread?
The following code calls the overridden method for formCreate() which creates a form and populates it when components.
// Splash form class
@Override
protected Form createForm() {
form = super.createForm(); // parent class method shown below
Container content = form.getContentPane();
form.setLayout(new BorderLayout());
Container container = new Container(new BoxLayout(BoxLayout.Y_AXIS));
// commenting out this code eliminates the ETD violation *
button = new Button("Start");
button.setUIID("Button");
button.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
gotoForm(new Main("/background.png"));
}
});
container.addComponent(button);
// ----------------------------------------------------- *
content.addComponent(BorderLayout.CENTER, container);
return form;
}
// Parent class SplashForm
@Override
protected Form createForm() {
form = super.createForm(); // Root class method shown below
setBackground(fileName);
return form;
}
// Root class RootForm
protected Form createForm() {
System.out.println(System.currentTimeMillis() + " RootForm.createForm" + name);
form = new Form();
form.setName(name);
return form;
}
//
// Root class method that invokes createForm()
//
public Form showForm() {
System.out.println(System.currentTimeMillis() + " RootForm.showForm" + name);
if (form == null) {
beforeCreate();
form = createForm();
afterCreate();
}
beforeShow();
form.show();
afterShow();
return form;
}
1392220548177 RootForm.ConstructorStartup
1392220554677 RootForm.showFormStartup
1392220554677 RootForm.beforeCreateStartup
1392220554677 RootForm.createFormStartup
1392220554692 RootForm.setBackgroundStartup
1392220554708 RootForm.afterCreateStartup
1392220554708 RootForm.beforeShowStartup
1392220554724 RootForm.afterShowStartup ---> Location Manager invoked 500ms synchronous call
1392220555442 RootForm.ConstructorSplash ---> location determined
1392220555442 RootForm.gotoFormStartup
1392220555442 RootForm.beforeExitStartup
1392220555442 RootForm.showFormSplash
1392220555442 RootForm.beforeCreateSplash
1392220555442 RootForm.createFormSplash
1392220555442 RootForm.setBackgroundSplash
1392220555474 RootForm.beforeShowSplash
EDT violation detected!