Re: JForm is a Swing component framework that supports databinding and validation.
- From: "Michael" <michaelb_530@xxxxxxxxxxx>
- Date: Sat, 31 Dec 2005 07:19:05 -0500
I was not able to find JForm on javadesktop.org (I found a JForms project
but not JForm). Is this still an open source project?
I created a similar tool, which might be of interest, where the default
forms are generated automatically from the beans that describe the problem
domain (custom forms can also be created with some additional effort). It
also goes a step further - relations are captured between classes and
encoded as first class objects. Then, the framework uses the relations to
automatically generate other features of the GUI, such as drag and drop,
undo/redo and database bindings.
This link shows some of the code to access the framework and incorporate
first class relations:
http://www.mammothsoftware.com/groovy_plugins/groovy_plugins.htm
This link shows some example default forms:
http://www.mammothsoftware.com/screenshots.htm
Regards,
Mike
www.mammothsoftware.com
"Develop Swing Applications in 5 Minutes"
<wlboluyt@xxxxxxxxx> wrote in message
news:1135945833.967090.22960@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> JForm is a Swing component framework that supports databinding and
> validation.
>
> JForm was first released in september 2003 as opensource project on
> dev.java.net.
> I tried to collaborate with JDNC, JGoodies and Spring RCP but no one
> was
> interested so I decided to continue development and use JForm in
> projects
> for my customers. Over the past years it has evolved into a production
> stable
> full featured Swing component framework.
>
> DataBinding with JForm is easy, With JForm's generic FormModel it's
> easy
> to bind to any kind of datasource like JavaBeans, ResultSet and
> Collections.
> Here's an example of binding a field to a JavaBean property.
> Suppose you have a bean like this and want to bind price:
>
> public class Product {
> private long int;
> private String description;
> private double price;
>
> public double getPrice() {
> return price;
> }
>
> public void setPrice(double price) {
> this.price = price;
> }
> }
>
> Only one line of code does the job: InputField price = new
> InputField("product.price");
>
> Well I can't make it any simpler than this. Notice the Product class
> does not
> subclass some super class or implement some interface so you can use
> your
> existing beans just the way they are.
>
> Okay how does binding work when you have a list with products where a
> user can
> select a product from the list. Again really easy (and still one line):
>
> SelectField product = new SelectField("products", "product");
>
> You don't have to worry about creating a model, JForm takes care of
> that!
> Ofcourse it's still possible to use your own custom model if you need
> to.
> And JForm automatically selects the product in the list for you.
>
> Back to our price field, the user entered/modified the price, JForm
> automatically
> validates the field value. When all is ok you get an onChange event.
> When the value is invalid an onError (ValidationError) is thrown and
> default
> focus is set to the field and the backgroundcolor is set to red to
> indicate an error.
> Ofcourse JForm cannot automatically validate every kind of type but
> don't panic, you
> can write your own custom validators. Each field can have as many
> validators as
> needed and (the same) validators are reusable for other fields as well.
>
> Another important requirement for forms is navigation better know as
> the 'tab index'.
> On a FormPage you can set the field that should get focus immediatly
> after the form is
> refreshed with setInitialFocusField(firstHourField). There are also
> methods to set
> the first and last focus field on a page so you can make nice focus
> 'loops'.
> And for the real die hards you can hardcode the tab index for each
> individual field.
>
> As a developer you want to know what's happening on a form, normally
> with Swing you
> have to add all kinds of listeners (action, focus, mouse, etc) to get
> events.
> With JForm all you have to do is set one field event handler and you
> only need to listen
> for the type of event(s) you're interested in. Event handling with
> JForm is much like
> JavaScript wich I personally find much easier. Currently supported
> events are:
> onFocus, onClick, onChange (value changed or selection changed) and
> onError.
>
> The people who designed Swing thought it would be nice to have a
> different model for
> comboboxes, lists and tables. We know better! JForm comes with a
> DataModel that can be
> used for combox, list and table. Write one model and use it everywhere
> (isn't this what
> Java is all about?). JForm's ComboField, ListField and TableField all
> have standard
> support for sorting and filtering (and more in the future). Ofcourse
> the currently selected
> value stays selected when sorting order has changed and/or a filter has
> changed.
>
> Talking about comboboxes, lists and tables... renderers!
> For list you need a ListCellRenderer and for table you need a
> TableCellRenderer...
> I don't know about you but I often find myself writing the same
> renderer for lists and tables.
> And whatif I want to use more than one renderer on the same list or
> table?
> I have reimplemented renderers so you can write a renderer that can be
> used for all components
> that support a renderer.
>
> I have not discussed all features of JForm here, once you have used
> it's full potential you
> discover writing (form-based) Swing applications can be real fun and
> safe you a lot of time!
>
> One more thing, as I understand developers find it hard to use
> threading with Swing or even how
> to start writing Swing applications. This year I have developed an
> application framework for Swing
> called SwingForms. SwingForms is a model-view-controller architecture
> that makes (multi)threading
> transparent and forces developers to write well structered Swing
> applications.
>
> For more information about JForm and SwingForms visit my website
> http://www.coderight.nl
>
> I wish everyone a happy new year,
> Will - CodeRight
>
.
- Follow-Ups:
- Re: JForm is a Swing component framework that supports databinding and validation.
- From: wlboluyt@xxxxxxxxx
- Re: JForm is a Swing component framework that supports databinding and validation.
- References:
- JForm is a Swing component framework that supports databinding and validation.
- From: wlboluyt@xxxxxxxxx
- JForm is a Swing component framework that supports databinding and validation.
- Prev by Date: Re: Newbie Problem with Java Label
- Next by Date: Re: JForm is a Swing component framework that supports databinding and validation.
- Previous by thread: JForm is a Swing component framework that supports databinding and validation.
- Next by thread: Re: JForm is a Swing component framework that supports databinding and validation.
- Index(es):