DZone
Java Zone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
  • Refcardz
  • Trend Reports
  • Webinars
  • Zones
  • |
    • Agile
    • AI
    • Big Data
    • Cloud
    • Database
    • DevOps
    • Integration
    • IoT
    • Java
    • Microservices
    • Open Source
    • Performance
    • Security
    • Web Dev
DZone > Java Zone > Swing is Especially Effective If...

Swing is Especially Effective If...

adam bien user avatar by
adam bien
·
Nov. 26, 08 · Java Zone · News
Like (0)
Save
Tweet
7.70K Views

Join the DZone community and get the full member experience.

Join For Free


  1. You know your target domain or business logic, so that you are able to design expressive and concise domain objects.


  2. You are thinking in "swing models", not the UI-components. If you understand your domain, you probably have an idea as well how to visualize the business concepts in object oriented way. The use of Swing models just becomes natural.


  3. You are starting with the domain objects covered with unit tests, then develop the Swing models - after that the work is almost complete. You "only" have to create the view and pass the model to it.


  4. You are NOT trying to work with the views directly and force them to behave in your way. This could become quite complex, cumbersome and very hard to maintain. E.g. if you are working with the JTable directly, instead of TableModel, even reordering the table columns can cause you some headaches. The are no issues with a custom model in this case.


  5. The use of TableCellRenderers and TableCellEditors in JTables helps you to visualize you domain objects directly - without any overhead.


  6. You are using visual designers like e.g. Matisse in pragmatic way and separate the generated, from your code.


  7. You have a clear concept how to bind (e.g. with reflection+annotations or JSR-295) the UI-components to domain objects and how and where to validate the input (e.g. in controllers, domain objects or converters).


  8. Try to leverage existing JavaBean patterns like PropertyChangeListener, PropertyChangeSupport and the already built-in listeners in the UI-components. There is lot of stuff which can be reused.


  9. If you spend more than half hour to solve a specific "Swing-problem", just stop hacking and use google to find a solution for your problem. There are amazingly good tutorials, articles and posts out there.


  10. If you lose your motivation. Just stop developing Swing, build a quick prototype with SWT/JFace for few hours (but use Tables and Trees). Your motivation should increase dramatically after this experiment :-)

From: Adam Bien's Weblog

Object (computer science) Database Concept (generic programming) Leverage (statistics) Prototype Testing Pass (software) Overhead (computing)

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • What Are Cookies in Servlets?
  • A First Look at CSS When and Else Statements
  • Suspicious Sortings in Unity, ASP.NET Core, and More
  • How To Deploy Apache Kafka With Kubernetes

Comments

Java Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • MVB Program
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends:

DZone.com is powered by 

AnswerHub logo