Marcus
Marcus

Reputation: 159

swing gui built at run time from NetBeans .form file

It is possible to build at run time a swing gui directly from a NetBeans .form file? Someting like one can do with xml files generated by Glade to build GTK GUIs or with QtDesigner for Qt GUIs.

Upvotes: 0

Views: 332

Answers (1)

madth3
madth3

Reputation: 7344

Possible? Maybe. Netbeans can recreate .java files from .form files and since Netbeans is open source, something could be done, in theory.

In reality, I have not seen this functionality and I don't think it would be easy to accomplish. Some obstacles that come to my head are:

  1. One must keep in mind that .form files don't preserve information about Java code that controls the behaviour of the interface, (Loading information, Listener's definition and such).

  2. In the default usage of Netbeans GUI builder, components are private to the frame/dialog that cointains them. If we want to handle those componente from outside, the default .form -> .java creation would have to be altered.

  3. Netbeans source code is huge and I would not expect it to be easy to split the required module.

Alternative

I'd take a look at JavaFX and the Java FX Scene Builder to see if they fit your requirements since they have been created with the idea of splitting UI definition and logic.

Upvotes: 1

Related Questions