The next time you have to build an application
that requires a GUI, consider using an existing application
framework.

If you decide to go this route, you have
options. Three popular platforms are
Eclipse
,
NetBeans
, and JLense. Most of the
functionality in these three platforms is pluggable. To get the
desired functionality, simply write plug-ins that do what you want
and then assemble them into an application.

Several benefits to using application
frameworks include:

  • You get a consistent look and feel across all
    of your applications.
  • You don’t have to write the same code over
    and over to create main windows, menus, etc.
  • You can take advantage of the frameworks’
    value-added widgets like toolbars, pop-ups, status bars, and
    logging facilities.

One big disadvantage to using a framework is
that you’ll have to learn a new API to be able to write your
plug-ins. All of the platforms will have the same basic features,
such as main windows, editors, and tasks, but each one will give
access to these resources in a different way. Another disadvantage
is that none of these frameworks are particularly small. All of the
frameworks mentioned in this tip weigh in at a few megs.

Although there are good and bad points to using
an application framework to create your applications, the payoff
can be substantial. If your organization writes applications whose
end users are used to working with polished commercial
applications, it’s definitely an option you should research.

Delivered each Thursday, our free Java newsletter provides insight and hands-on tips you need to unlock the full potential of this programming language. Automatically sign up today!