Ironcache
Ironcache

Reputation: 1759

JFormDesigner Runtime Library Doesn't Load Custom Code

I've been using JFormDesigner with the runtime library to create dialogs directly from the .jfd files at runtime (I can't change this; not my decision). My problem is that the runtime library doesn't seem to preserve any custom code generation listed in the .jfd file. For example, if I have a simple panel, with the background set to red, and a post-initialization command to set the background to green, the runtime library will yield a red background, while directly loading the generated .java file will properly set the background to green.

Here's a code sample of what I'm doing:

public class EntryPoint
{
    public static void main( String[] args )
    {
        // Load .jfd file.  Shows red background (incorrect).
        String form = "testProject/entry/TestDialog.jfd";
        new EntryPoint(form);

        // Load .java file.  Shows green background (correct).
        JFrame frame = new JFrame();
        TestDialog test = new TestDialog( frame );
        test.setVisible( true );
    }

    EntryPoint( String form )
    {
        try
        {
            // Example loading
            // see http://www.formdev.com/jformdesigner/doc/runtime-library/
            FormModel formModel = FormLoader.load( form );

            FormCreator formCreator = new FormCreator(formModel);
            formCreator.setTarget(this);
            JDialog dialog = formCreator.createDialog(null);

            dialog.setModal(true);
            dialog.pack();
            dialog.show();
        }
        catch( Exception e )
        {
            e.printStackTrace();
        }
    }
}

I took a quick look at the documentation, but to no avail. I have an e-mail sent to JFD's support team, and will update the question if I get any response. I'm looking through the runtime library code now (it's open source), but was curious if anyone had any info on it before I go too far down the rabbit hole. Thanks.

Upvotes: 1

Views: 288

Answers (1)

Ironcache
Ironcache

Reputation: 1759

Support replied; feature not currently supported (as of version 5.2).

Upvotes: 1

Related Questions