Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 887455
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T13:14:01+00:00 2026-05-15T13:14:01+00:00

Even if I’m not new to Java, I’ve only used it in school/university environment

  • 0

Even if I’m not new to Java, I’ve only used it in school/university environment so I don’t know all the best practices used in the enterprise.

In particular I’m now developing a Java desktop application (using Swing at the UI Layer) and I’m particularly interested in best practices about data binding with swing components.

For example I could have a List of model objects at the model layer and I need to show them in a JTable. Then, when a single row of the JTable is selected, I need to display some information regarding the model object corresponding to the selected row on some JLabels.

What libraries should I use? What are the best practices to do so?

I’m looking for some links/articles/tutorials(/books?) to dive into this topic and to learn about pros and cons of the various solutions.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T13:14:01+00:00Added an answer on May 15, 2026 at 1:14 pm

    For the specific example you give I would recommend the following approach:

    1. Represent your model objects as a List<Model> where the List implementation supports RandomAccess (e.g. an ArrayList).
    2. Subclass AbstractTableModel and override getValueAt(int row, int col) to index into your List<Model> and retrieve the appropriate Model instance. Then return the particular attribute you wish to bind to column: col.

    In general I roll my own when it comes to data binding rather than use a framework. For editor-style panels I typically implement three methods: initialise(), commit() and clear(), whereby initialise takes an instance of the domain object being edited, commit applies any changes and returns a modified instance of the domain object, and clear clears all UI component values or sets them back to default values.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Even if I know it's not ideal - I need to programmatically populate a
Even though I know that, at least to my knowledge, this is not the
Even though I'm pretty sure I know why this error gets raised, I don't
Even though it's not part of HTTP 1.1/RFC2616 webapps that wish to force a
Even I used break() and exit() statements many times, I am bit confused between
Even if I have different modules in my Java EE application including myproject-web and
Even after a lot of research, I still don't figure out why I've got
Even after a lot of research, I still don't figure out why I've got
Even looking closely over documentation on Clojure, I do not see any direct confirmation
Even why I can remove rows on read-only DataGridView? I can set Enabled to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.