users
[Top] [All Lists]

Re: [cinjug-users] Tool for Swing

To: users@xxxxxxxxxx
Subject: Re: [cinjug-users] Tool for Swing
From: "Edward Sumerfield" <esumerfd@xxxxxxxxxxxxxx>
Date: Tue, 10 Apr 2007 18:19:22 -0400
Delivered-to: mailing list users@xxxxxxxxxx
Dkim-signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:reply-to:sender:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=gxyDB/D55qOmj4qcTZpfNRbCwCDeA5WYv8F1RFnCHx+Av+EkOKqdwKBCgED3ymPfLUmSegjmMLwWSA41BKcHjllnzKN3u/kmcnN/amZdVuaTXjEYL7pjBTrvX8v+K3mysEUnDo2XAVAsOSzR3U1L0zdKrPoLyw7yx0ylsS/68hg=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:reply-to:sender:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=dBduokW05yJdcSWhw7ZvMHWgdD/RM1FKesjkw7L1QhKeylvQU8MMe0VkGUp9FnfAzuLXe3tuXkPR39z4G1EEDY1M+oMVaS3U+zLcvRU/XKsHmHm0QHr2h4rFVvm0GysEQZjIG56BM4hQY/lgbq5Zqw8q+zvf8Ut8nkwL618vfcs=
In-reply-to: <461C0749.3080307@xxxxxxxx>
Mailing-list: contact users-help@xxxxxxxxxx; run by ezmlm
References: <461C0749.3080307@xxxxxxxx>
Reply-to: esumerfd@xxxxxxxxxxxxxx
Sender: esumerfd@xxxxxxxxx
The best way to build swing applications these days is to use an RCP
(Rich Client Platform). The main RCP's out there are

   http://platform.netbeans.org/
   http://wiki.eclipse.org/index.php/Rich_Client_Platform

There are others but, based on the hype train, they are not as complete.

Obviously, NetBeans for swing and Eclipse for SWT apps.

As far as books and info is concerned there is not much. Your swing
books will go into lots of details on how to put the correct font and
color on your swing buttons but will never touch a database.

Martin Fowler had an article on how to put an architecture together
but I can't seem to find the reference at the moment.

The problem you have is, and we can start the flame war now, swing
sucks. It sucks so badly that it is hard to know where to start.
Unfortunately, you can achieve great things with swing. Since you can,
with lots of work and hacking, achieve great things, no one is
interested in scrapping the pile of nasty nasty concrete class,
tightly coupled, inflexible, hard to test, and (unless you do it
right) slow crap.

I don't think this is helping is it. From a high level.

Make sure you think about threading because it will kill you if you
don't. Use Spin (http://spin.sourceforge.net) for this, it has a nice
web site that describes the issues.

Isolate your data into models that group "info to be displayed by X
components". You might have a cluster of panels with various
components on them. Each of these components should get its data from
a single model. The model isolates the data IO loading and saving etc.
A data model  should expose a "get" and "set" method to the ui and
thats basically it. I use the OGNL library as the only interface that
ui components use to get their data. The get method takes a property
expression which has worked pretty well.

Always, always use your own components. Never never use J anything.
This usually involves inheritance because of the nasty nasty suckey
way that swing is designed but I have been over that.

There are some cool ways to abstract a standard interface to your ui
components but its hard, requires lots of duplication to get around
the nasty nasty ... oh yes, been there. You want this so that you can
write generic ui component management tools to simplify your life,
like "find and validate all my required fields".

You will end up with your ui components, your swing model components
and your data model.

    JTextField
        ^
   MyTextField -> MyDocumentModel -> MyDataModel -> Hibernate etc

The whole visual designer issue is a problem. You can have factory
constructed ui components and use a visual design to get your layout
but its hard and usually a little ugly because swing sucks.

Here I am writing an essay, I wish there was a book out there title
"Swing Sucks and this is how to beat it into submission".

Good luck.

On 4/10/07, Jim Paul <jimpaul@xxxxxxxx> wrote:
Gentlemen & women,

I'm re-writing the simple application I use for professional billing
with Swing and JDBC as a learning exercise.  I have gone through several
simple Swing tutorials.  Can anyone recommend a next step like :

A free tool that helps build Swing/Database applications.  Ideally it
would not isolate me from coding since the goal is to learn.

Or a simple application that I could modify.  Basically just need to
enter multi-line invoices and apply payments to them.

P.S. I use Eclipse.

Thanks
Jim

---------
You may unsubscribe from this mailing list
by sending a blank email addressed to:
users-unsubscribe@xxxxxxxxxx

--
Find additional help by sending a blank email
addressed to:
users-help@xxxxxxxxxx




--
Ed

<Prev in Thread] Current Thread [Next in Thread>